Skip to content

Commit

Permalink
detect codebuild build dir
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsto committed Aug 2, 2024
1 parent 861b297 commit 1e552e8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions code/ci_actions/00_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ else
export AWS_CLI=$BREW_PATH/aws
fi

if [ ! -z ${AWS_REGION} ]; then
export REGION=$(curl -s 169.254.169.254/latest/meta-data/placement/region/)
else
if [! -z ${AWS_REGION} ]; then
export REGION=$AWS_REGION
else
export REGION=$(curl -s 169.254.169.254/latest/meta-data/placement/region/)
fi
export LANG=en_US.UTF-8

Expand All @@ -27,6 +27,9 @@ fi
if [ ! -z ${CIRCLE_WORKING_DIRECTORY} ]; then # we are running from a gitlab runner
export CODE_DIR=$CIRCLE_WORKING_DIRECTORY/code
fi
if [ ! -z ${CODEBUILD_SRC_DIR} ]; then # we are running inside AWS CodeBuild
export CODE_DIR=$CODEBUILD_SRC_DIR/code
fi

echo "Default region: $REGION"
echo "AWS CLI : $AWS_CLI"
Expand Down

0 comments on commit 1e552e8

Please sign in to comment.