Skip to content

Instantly share code, notes, and snippets.

@yaya2devops
Created April 15, 2023 17:55
Show Gist options
  • Save yaya2devops/08dc23d60a6804b7add963eff4fbce03 to your computer and use it in GitHub Desktop.
Save yaya2devops/08dc23d60a6804b7add963eff4fbce03 to your computer and use it in GitHub Desktop.
AWS CLOUD PROJECT BOOTCAMP 2023 - WEEK 9
version: 0.2
phases:
install:
runtime-versions:
docker: 19
commands:
- echo "cd into $CODEBUILD_SRC_DIR/backend"
- cd $CODEBUILD_SRC_DIR/backend-flask
- "aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $IMAGE_URL"
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- docker build -t backend-flask .
- "docker tag $REPO_NAME $IMAGE_URL/$REPO_NAME"
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker image..
- "docker push $IMAGE_URL/$REPO_NAME"
- echo "imagedefinitions.json > [{\"name\":\"$CONTAINER_NAME\",\"imageUri\":\"$IMAGE_URL/$REPO_NAME\"}]" > imagedefinitions.json
- printf "[{\"name\":\"$CONTAINER_NAME\",\"imageUri\":\"$IMAGE_URL/$REPO_NAME\"}]" > imagedefinitions.json
env:
variables:
AWS_ACCOUNT_ID: 598485450821
CONTAINER_NAME: backend-flask
IMAGE_URL: 598485450821.dkr.ecr.ca-central-1.amazonaws.com
REPO_NAME: backend-flask:latest
AWS_COGNITO_USER_POOL_CLIENT_ID: 5il3116qm0rh3ropspnirktnls
AWS_COGNITO_USER_POOL_ID: ca-central-1_RT6uZ6IkV
AWS_DEFAULT_REGION: ca-central-1
BACKEND_URL: "*"
FRONTEND_URL: "*"
OTEL_EXPORTER_OTLP_ENDPOINT: https://api.honeycomb.io
OTEL_SERVICE_NAME: backend-flask
parameter-store:
AWS_ACCESS_KEY_ID: /cruddur/backend-flask/AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: /cruddur/backend-flask/AWS_SECRET_ACCESS_KEY
CONNECTION_URL: /cruddur/backend-flask/CONNECTION_URL
OTEL_EXPORTER_OTLP_HEADERS: /cruddur/backend-flask/OTEL_EXPORTER_OTLP_HEADERS
ROLLBAR_ACCESS_TOKEN: /cruddur/backend-flask/ROLLBAR_ACCESS_TOKEN
artifacts:
files:
- imagedefinitions.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment