From baa87a0a11784ad96197dbf750bd17a9d164f6ed Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Fri, 16 Oct 2020 08:05:18 -0400 Subject: [PATCH] Fix make-release args (#5347) ### Description - Pass `--dry_run` arg - Fix `build_directory` arg ### Tested Not tested --- packages/docs/community/release-process/smart-contracts.md | 2 +- packages/protocol/scripts/bash/make-release.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/docs/community/release-process/smart-contracts.md b/packages/docs/community/release-process/smart-contracts.md index d1aca65ca25..43c4301d911 100644 --- a/packages/docs/community/release-process/smart-contracts.md +++ b/packages/docs/community/release-process/smart-contracts.md @@ -86,7 +86,7 @@ This should be used in tandem with `verify-deployed -b $PREVIOUS_RELEASE -n $NET ### Deploy New Contracts -Use the following script to build a candidate release and, using the corresponding backwards compatibility report, deploy **changed** contracts to the specified network. +Use the following script to build a candidate release and, using the corresponding backwards compatibility report, deploy **changed** contracts to the specified network. (Use `-d` to dry-run the deploy). STORAGE updates are adopted by deploying a new proxy/implementation pair. These new contracts may need to be initialized, for which values can be provided. Outputs a JSON contract upgrade governance proposal. ```bash diff --git a/packages/protocol/scripts/bash/make-release.sh b/packages/protocol/scripts/bash/make-release.sh index 9c012892934..1a90718a31d 100755 --- a/packages/protocol/scripts/bash/make-release.sh +++ b/packages/protocol/scripts/bash/make-release.sh @@ -10,20 +10,23 @@ set -euo pipefail # -p: Path that the governance proposal should be written to. # -i: Path to the data needed to initialize contracts. # -r: Path to the contract compatibility report. +# -d: Whether to dry-run this deploy NETWORK="" PROPOSAL="" BRANCH="" INITIALIZE_DATA="" REPORT="" +DRYRUN="" -while getopts 'a:b:n:p:i:r:' flag; do +while getopts 'a:b:n:p:i:r:d' flag; do case "${flag}" in b) BRANCH="${OPTARG}" ;; n) NETWORK="${OPTARG}" ;; p) PROPOSAL="${OPTARG}" ;; i) INITIALIZE_DATA="${OPTARG}" ;; r) REPORT="${OPTARG}" ;; + d) DRYRUN="--dry_run" *) error "Unexpected option ${flag}" ;; esac done @@ -42,4 +45,4 @@ yarn build rm -rf $BUILD_DIR && mkdir -p $BUILD_DIR mv build/contracts $BUILD_DIR -yarn run truffle exec ./scripts/truffle/make-release.js --network $NETWORK --build_artifacts $BUILD_DIR/contracts --report $REPORT --proposal $PROPOSAL --initialize_data $INITIALIZE_DATA +yarn run truffle exec ./scripts/truffle/make-release.js --network $NETWORK --build_directory $BUILD_DIR/contracts --report $REPORT --proposal $PROPOSAL --initialize_data $INITIALIZE_DATA $DRYRUN