# CodeBuild buildspec file for creating container images for a workflow tool # assumes the following environment variables: # - PROJECT_BRANCH: git branch / tag / commit-id to build # - PROJECT_PATH: path in the source to navigate to prior to build # - REGISTRY: docker image registry (e.g. ECR) to push the container image to # - IMAGE_NAME: name of the container image # - IMAGE_TAG: tag for the container image (will also push as "latest") # - AWS_REGION: (Provided by CodeBuild) region to use for ECR version: 0.2 phases: pre_build: commands: - git checkout $PROJECT_BRANCH - cd $PROJECT_PATH - cp -R ../_common . build: commands: - echo "Building container image" - chmod +x _common/build.sh - _common/build.sh ${IMAGE_NAME} ${IMAGE_TAG} post_build: commands: - echo "Pushing container image" - chmod +x _common/push.sh - _common/push.sh ${IMAGE_NAME} ${IMAGE_TAG}