Skip to content

Commit

Permalink
Experimenting with buildspec.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
chosak committed Nov 27, 2024
1 parent 286d94c commit 8490673
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 0.2

env:
variables:
SERVICE_NAME: friendly-umbrella
CONTACTS_SECRET: cfpb/team/cfgov/contact-info
IMAGE_SCANNER_SECRET: cfpb/team/cfgov/image-scanner-creds
SMTP_CREDS_SECRET: cfpb/team/cfgov/smtp-ses-creds
secrets-manager:
EMAIL_TO: "${CONTACTS_SECRET}:developers"
IMAGE_SCANNER_URL: "${IMAGE_SCANNER_SECRET}:url"
IMAGE_SCANNER_USERNAME: "${IMAGE_SCANNER_SECRET}:username"
IMAGE_SCANNER_PASSWORD: "${IMAGE_SCANNER_SECRET}:password"
SMTP_HOST: "${SMTP_CREDS_SECRET}:smtp_server"
SMTP_PORT: "${SMTP_CREDS_SECRET}:smtp_port"
SMTP_USERNAME: "${SMTP_CREDS_SECRET}:username"
SMTP_PASSWORD: "${SMTP_CREDS_SECRET}:password"

phases:
install:
commands:
- codebuild-init && source ./env.sh
pre_build:
commands:
- export IMAGE_NAME="cfpb/${NAMESPACE}/${SERVICE_NAME}"
- export IMAGE_TAG=$GIT_REF
- export REGISTRY_IMAGE_NAME="${ECR_ACCOUNT_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}"
build:
commands:
- docker build -t $REGISTRY_IMAGE_NAME .
- scan-image $REGISTRY_IMAGE_NAME $EMAIL_TO
- docker push $REGISTRY_IMAGE_NAME

0 comments on commit 8490673

Please sign in to comment.