This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: ./bws-secret-get.sh <SECRET_NAME> | |
set -eo pipefail | |
if [ -z $BWS_ACCESS_TOKEN ]; then | |
>&2 echo "Missing access token. Please set your access token. Eg: export BWS_ACCESS_TOKEN=REPLACEME" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [[ ! -f package.json ]] ; then | |
echo "File package.json doesn't exist. Run npm init and npm install first." | |
exit | |
fi | |
npm ci | |
mkdir -p dist/lambda_layer/nodejs/node_modules | |
cp -r node_modules dist/lambda_layer/nodejs/ | |
cd dist/lambda_layer && zip -r lambda_layer.zip nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options: | |
docker: true | |
definitions: | |
commonItems: | |
- &getOidcToken export AWS_WEB_IDENTITY_TOKEN_FILE=$(pwd)/web-identity-token && echo $BITBUCKET_STEP_OIDC_TOKEN > $(pwd)/web-identity-token | |
- &terraformInit set -x && terraform -chdir=$TF_WORKDIR init | |
-backend-config="bucket=$TFSTATE_BUCKET" | |
-backend-config="key=$TFSTATE_KEY" | |
-backend-config="region=$TFSTATE_REGION" && |