diff --git a/.codebuild/build.sh b/.codebuild/build.sh index c3fc85bc..a45243cd 100644 --- a/.codebuild/build.sh +++ b/.codebuild/build.sh @@ -66,7 +66,6 @@ deploy_hathor_network_account() { send_slack_message "New version deployed to mainnet-staging: ${GIT_REF_TO_DEPLOY}" elif expr "${GIT_REF_TO_DEPLOY}" : "v.*" >/dev/null; then echo $GIT_REF_TO_DEPLOY > /tmp/docker_image_tag - make build-daemon; # --- Testnet --- # Gets all env vars with `testnet_` prefix and re-exports them without the prefix @@ -75,29 +74,35 @@ deploy_hathor_network_account() { done make migrate; + make build-daemon; make deploy-lambdas-testnet; + # The idea here is that if the lambdas deploy fail, the built image won't be pushed: + make push-daemon; # Unsets all the testnet env vars so we make sure they don't leak to other deploys for var in "${!testnet_@}"; do unset ${var#testnet_} done + send_slack_message "New version deployed to testnet-production: ${GIT_REF_TO_DEPLOY}" + # --- Mainnet --- # Gets all env vars with `mainnet_` prefix and re-exports them without the prefix for var in "${!mainnet_@}"; do export ${var#mainnet_}="${!var}" done make migrate; + make build-daemon; make deploy-lambdas-mainnet; + # The idea here is that if the lambdas deploy fail, the built image won't be pushed: + make push-daemon; # Unsets all the mainnet env vars so we make sure they don't leak to other deploys for var in "${!mainnet_@}"; do unset ${var#mainnet_} done - # The idea here is that if the lambdas deploy fail, the built image won't be pushed: - make push-daemon; - send_slack_message "New version deployed to testnet-production and mainnet-production: ${GIT_REF_TO_DEPLOY}" + send_slack_message "New version deployed to mainnet-production: ${GIT_REF_TO_DEPLOY}" else # Gets all env vars with `dev_` prefix and re-exports them without the prefix for var in "${!dev_@}"; do diff --git a/scripts/push-daemon.sh b/scripts/push-daemon.sh index b186545b..2af968ca 100644 --- a/scripts/push-daemon.sh +++ b/scripts/push-daemon.sh @@ -1,6 +1,11 @@ set -e set -o pipefail +if [ -z "$ACCOUNT_ID" ]; then + echo "Please export a ACCOUNT_ID env var before running this"; + exit 1; +fi + DOCKER_IMAGE_TAG=$(cat /tmp/docker_image_tag) if [ -z "$DOCKER_IMAGE_TAG" ]; then