-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
25 lines (21 loc) · 892 Bytes
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
version: 0.2
phases:
pre_build:
runtime_versions:
nodejs: 18.12.1
commands:
- echo Started Creating Work Environment
- npm install && npm install -g @angular/cli
- echo Performing AWS Container Registry Login
- 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
- REPOSITORY_URI=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME
build:
commands:
- echo Building Docker of the Angular Program
- docker build -t $REPOSITORY_URI:$IMAGE_TAG .
- docker tag $REPOSITORY_URI:$IMAGE_TAG $REPOSITORY_URI:IMAGE_TAG
post_build:
commands:
- echo Pushing Angular Docker Image to AWS ECR
- docker push $REPOSITORY_URI:$IMAGE_TAG
- echo Operation Completed Successfully!