-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
21 lines (20 loc) · 1.86 KB
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
version: 0.2
phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com
- aws ecr describe-repositories --repository-names promplanner_prod
build:
commands:
- echo Build started on `date`
- echo Pulling baseline Docker Image
- docker pull $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/promplanner_prod:latest
- echo Building the Docker image...
- docker build --build-arg source_folder=$PORTAL --build-arg aws_default_region=$AWS_DEFAULT_REGION --build-arg source_container=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/promplanner_prod:latest --build-arg app_url=$APP_URL --build-arg app_key=$APP_KEY --build-arg db_host=$DB_HOST --build-arg db_username=$DB_USERNAME --build-arg db_password=$DB_PASSWORD --build-arg aws_access_key_id=$AWS_S3_ACCESS_KEY_ID --build-arg aws_secret_access_key=$AWS_S3_SECRET_ACCESS_KEY --build-arg aws_default_region=$AWS_S3_DEFAULT_REGION --build-arg aws_bucket=$AWS_BUCKET --build-arg aws_use_path_style_endpoint=$AWS_USE_PATH_STYLE_ENDPOINT --build-arg mail_password=$MAIL_PASSWORD --build-arg mail_username=$MAIL_USERNAME --build-arg paypal_sandbox_client_id=$PAYPAL_SANDBOX_CLIENT_ID --build-arg paypal_sandbox_client_secret=$PAYPAL_SANDBOX_CLIENT_SECRET --build-arg asset_url=$ASSET_URL -t promplanner_prod:latest_$PORTAL --progress=plain --no-cache .
- docker tag promplanner_prod:latest_$PORTAL $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/promplanner_prod:latest_$PORTAL
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker image...
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/promplanner_prod:latest_$PORTAL