version: 0.2 phases: install: commands: - apt-get update - apt-get install python3 python3-pip -y - update-alternatives --install /usr/bin/python python /usr/bin/python3 10 - update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10 - pip install awscli --upgrade --user - pip install rsa - pip install typing build: commands: - echo "Started." - STAGING_REPOSITORY_URL="https://$GITHUB_ACCESS_TOKEN@github.com/$STAGING_GITHUB_REPOSITORY.git" - tmpdir=`mktemp -d` - git config --global user.name "AWS" - git config --global user.email "<>" - git clone -n $STAGING_REPOSITORY_URL $tmpdir - cp -r $tmpdir/.git $CODEBUILD_SRC_DIR - git add -A - | if [ $(git status --porcelain | wc -c) -ne 0 ]; then git commit -am "Staged sources"; fi; - git push - - SUBJECT="Build SUCCESS:PushStagedSdk" - RELEASE_ID=`(grep -w releaseId | cut -d= -f2) <$RELEASE_PROPERTIES` - echo $RELEASE_ID - SNS_MESSAGE_BODY='{"jobName":"VerifyStagedSdk", "phase":"COMPLETED","result":"SUCCESS", "releaseId":"'"$RELEASE_ID"'"}' - aws --region us-west-2 sns publish --message "$SNS_MESSAGE_BODY" --topic $SNS_TOPIC --subject "$SUBJECT" - echo "Staging Done."