Skip to content

Commit

Permalink
Avoid overloading AWS_REGION
Browse files Browse the repository at this point in the history
  • Loading branch information
noodl committed Sep 6, 2024
1 parent 4a8945b commit 62f87ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hooks/post-command
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

ACTION="$BUILDKITE_PLUGIN_SBC_SHARED_ACTION"

if [[ $ACTION == "push_image" ]];then
if [[ $ACTION == "push_image" ]]; then
echo "--- :floppy_disk: Push $ENVIRONMENT image for $APP"

# Push the docker image
Expand Down
4 changes: 2 additions & 2 deletions hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ if [[ -z $GEM_HOST ]]; then
unset GEM_HOST
fi

# Only export the AWS_REGION if it was specified to be overriden.
# Only export the REGION if it was specified to be overriden.
if [[ -n $BUILDKITE_PLUGIN_SBC_SHARED_REGION ]]; then
export AWS_REGION="${BUILDKITE_PLUGIN_SBC_SHARED_REGION}"
export REGION="${BUILDKITE_PLUGIN_SBC_SHARED_REGION}"
fi

# If the target image needs to have a custom tag other than the GH tag/branch
Expand Down
4 changes: 2 additions & 2 deletions lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ push_image () {
switches "$@"
validate_switches account_id app tag multiarch
varx BUILDKITE_BUILD_NUMBER
varx AWS_REGION
varx REGION
varx BK_BRANCH

# If the override ENV option was specified in the pipeline, use that tag value.
Expand All @@ -137,7 +137,7 @@ push_image () {
X86_64_TAG_SUFFIX=-x86_64
fi

TARGET_ECR=$account_id.dkr.ecr.$AWS_REGION.amazonaws.com/$REPO:$target_tag
TARGET_ECR=$account_id.dkr.ecr.$REGION.amazonaws.com/$REPO:$target_tag

SOURCE_IMAGE_X86_64=$BK_ECR:$app-$tag-build-$BUILDKITE_BUILD_NUMBER
TARGET_IMAGE_X86_64=$TARGET_ECR$X86_64_TAG_SUFFIX
Expand Down

0 comments on commit 62f87ad

Please sign in to comment.