Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
phases:
install:
commands:
- . config/change_branch.sh
- . config/clone_source.sh
- su && apt-get update
- apt-get install sudo -qq -o=Dpkg::Use-Pty=0 # silence output: https://askubuntu.com/a/668859/724247
- sudo apt-get update -qq -o=Dpkg::Use-Pty=0
Expand Down
4 changes: 3 additions & 1 deletion config/change_branch.sh → config/clone_source.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
git clone https://github.com/awslabs/git-secrets.git && cd git-secrets && make install

export CODEBUILD_GIT_BRANCH="$(git symbolic-ref HEAD --short 2>/dev/null)"
if [ "$CODEBUILD_GIT_BRANCH" = "" ] ; then
CODEBUILD_GIT_BRANCH="$(git branch -a --contains HEAD | sed -n 2p | awk '{ printf $1 }')";
export CODEBUILD_GIT_BRANCH=${CODEBUILD_GIT_BRANCH#remotes/origin/};
fi

cd $CODEBUILD_SRC_DIR && git checkout $CODEBUILD_GIT_BRANCH
cd $CODEBUILD_SRC_DIR && git secrets --install && git secrets --register-aws && git checkout $CODEBUILD_GIT_BRANCH
export CURRENT_COMMIT_HASH=$(git log -1 --pretty=%h);
#export CURRENT_COMMIT_DATE="$(git show -s --format=%ci | cut -d' ' -f 1)$(git show -s --format=%ci | cut -d' ' -f 2)";
export CURRENT_DATETIME=$(date +'%Y%m%d_%H%M%S')
Expand Down
1 change: 1 addition & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AWS_ACCESS_KEY_ID=AKIAIOSFODNN7RXAMPLE