Skip to content

Commit

Permalink
allow configuring full preupgrade version name (dydxprotocol#2108)
Browse files Browse the repository at this point in the history
  • Loading branch information
roy-dydx committed Aug 19, 2024
1 parent ba3492b commit 5998dfc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion protocol/testing/containertest/containertest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ download_preupgrade_binary() {
exit 1
;;
esac
tar_url="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2F$PREUPGRADE_VERSION/dydxprotocold-$PREUPGRADE_VERSION-linux-$url_arch.tar.gz"
tar_url="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2F$PREUPGRADE_VERSION_FULL_NAME/dydxprotocold-$PREUPGRADE_VERSION_FULL_NAME-linux-$url_arch.tar.gz"
tar_path='/tmp/dydxprotocold/dydxprotocold.tar.gz'
mkdir -p /tmp/dydxprotocold
curl -vL $tar_url -o $tar_path
Expand Down
6 changes: 5 additions & 1 deletion protocol/testing/version/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
This directory contains files to configure version names used for upgrade tests and internal nodes. These versions are used for things such as upgrade proposals and cosmovisor directory names. When updating tests and images for a new version, most of the time you just need to change the `VERSION_CURRENT` and `VERSION_PREUPGRADE` files.
This directory contains files to configure version names used for upgrade tests and internal nodes. These versions are used for things such as upgrade proposals and cosmovisor directory names. When updating tests and images for a new version, most of the time you just need to change the `VERSION_CURRENT`, `VERSION_PREUPGRADE`, and `VERSION_FULL_NAME_PREUPGRADE` files.

`VERSION_CURRENT` is the upgrade name for the current version. e.g. v6.0.0 is the upgrade name for v6.0.0, v6.0.1, v6.0.0-rc0, etc.
`VERSION_PREUPGRADE` is the upgrade name for the preupgrade version. e.g. v6.0.0 is the upgrade name for v6.0.0, v6.0.1, v6.0.0-rc0, etc.
`VERSION_FULL_NAME_PREUPGRADE` is the fully qualified preupgrade version name. This is used in the download url. e.g. v6.0.0-rc0.
1 change: 1 addition & 0 deletions protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v5.2.0
3 changes: 2 additions & 1 deletion protocol/testing/version/version.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
CURRENT_VERSION=$(<VERSION_CURRENT)
PREUPGRADE_VERSION=$(<VERSION_PREUPGRADE)
PREUPGRADE_VERSION_FULL_NAME=$(<VERSION_FULL_NAME_PREUPGRADE)

# Define the mapping from version to amd64 URL
declare -A version_to_url
version_to_url["$PREUPGRADE_VERSION"]="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2F$PREUPGRADE_VERSION/dydxprotocold-$PREUPGRADE_VERSION-linux-amd64.tar.gz"
version_to_url["$PREUPGRADE_VERSION"]="https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2F$PREUPGRADE_VERSION_FULL_NAME/dydxprotocold-$PREUPGRADE_VERSION_FULL_NAME-linux-amd64.tar.gz"

0 comments on commit 5998dfc

Please sign in to comment.