Skip to content

Instantly share code, notes, and snippets.

@samhstn
Created November 20, 2020 15:59
Show Gist options
  • Save samhstn/33039fb2c20aff9f4c3bee476fc1c767 to your computer and use it in GitHub Desktop.
Save samhstn/33039fb2c20aff9f4c3bee476fc1c767 to your computer and use it in GitHub Desktop.
# Following instructions here:
# https://aws.amazon.com/blogs/devops/announcing-local-build-support-for-aws-codebuild/
curl -o codebuild_build.sh https://raw.githubusercontent.com/aws/aws-codebuild-docker-images/master/local_builds/codebuild_build.sh
chmod +x codebuild_build.sh
source .env
S3_CODEBUILD_BUCKET_NAME=samhstn-codebuild-${AWS_ADMIN_ACCOUNT_ID}
ROUTE_53_ROLE_ARN="$(aws cloudformation describe-stacks \
--profile samhstn-root \
--stack-name route53role \
--query "Stacks[*].Outputs[?OutputKey=='Route53RoleArn'].OutputValue|[0][0]" \
--output text 2>&1)"
cat > .codebuild_envs<< EOF
S3_CODEBUILD_BUCKET_NAME=$S3_CODEBUILD_BUCKET_NAME
ROUTE_53_ROLE_ARN=$ROUTE_53_ROLE_ARN
SAMHSTN_HOSTED_ZONE_ID=$SAMHSTN_HOSTED_ZONE_ID
EOF
./codebuild_build.sh -i $AWS_ADMIN_ACCOUNT_ID.dkr.ecr.eu-west-1.amazonaws.com/samhstn -a ./artifacts -b infra/samhstn/buildspec.yml -e .codebuild_envs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment