File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 17
17
- run : set +o pipefail docker load -i /caches/app.tar | true
18
18
19
19
# Building.
20
- - run : docker build --build-arg ENV=development --cache-from=$DEV_AWS_ACCOUNT_ID.dkr.ecr.$DEV_AWS_REGION.amazonaws.com/community-app -t $DEV_AWS_ACCOUNT_ID.dkr.ecr.$DEV_AWS_REGION.amazonaws.com/community-app .
20
+ - run : docker build --build-arg ENV=development --cache-from=$DEV_AWS_ACCOUNT_ID.dkr.ecr.$DEV_AWS_REGION.amazonaws.com/community-app -t $DEV_AWS_ACCOUNT_ID.dkr.ecr.$DEV_AWS_REGION.amazonaws.com/community-app:$CIRCLE_SHA1 .
21
21
22
22
# Updating the cache.
23
23
- run : mkdir -p /caches && docker save -o /caches/app.tar $DEV_AWS_ACCOUNT_ID.dkr.ecr.$DEV_AWS_REGION.amazonaws.com/community-app
@@ -27,10 +27,10 @@ jobs:
27
27
- /caches/app.tar
28
28
29
29
# Deployment.
30
- - run : apk add --update bash py-pip
31
- - run : pip install awscli --upgrade --user
30
+ - run : apk add --update bash jq py-pip sudo
31
+ - run : sudo pip install awscli --upgrade
32
32
- deploy :
33
- command : ./deploy.sh DEV
33
+ command : ./deploy.sh DEV $CIRCLE_SHA1
34
34
35
35
# Test job for the cases when we do not need deployment. It just rapidly
36
36
# installs (updates) app dependencies, and runs tests (ESLint, Stylelint,
Original file line number Diff line number Diff line change 4
4
JQ=" jq --raw-output --exit-status"
5
5
6
6
ENV=$1
7
+ TAG=$2
7
8
8
9
AWS_REGION=$( eval " echo \$ ${ENV} _AWS_REGION" )
9
10
AWS_ECS_CLUSTER=$( eval " echo \$ ${ENV} _AWS_ECS_CLUSTER" )
@@ -75,13 +76,13 @@ make_task_def(){
75
76
NODE_ENV=development
76
77
fi
77
78
78
- task_def=$( printf " $task_template " $ACCOUNT_ID $AWS_REGION $AWS_REPOSITORY $NODE_ENV $AWS_ECS_CLUSTER $AWS_REGION )
79
+ task_def=$( printf " $task_template " $ACCOUNT_ID $AWS_REGION $AWS_REPOSITORY $TAG $ NODE_ENV $AWS_ECS_CLUSTER $AWS_REGION )
79
80
}
80
81
81
82
push_ecr_image () {
82
83
echo " Pushing Docker Image..."
83
84
eval $( aws ecr get-login --region $AWS_REGION )
84
- docker push $ACCOUNT_ID .dkr.ecr.$AWS_REGION .amazonaws.com/$AWS_REPOSITORY
85
+ docker push $ACCOUNT_ID .dkr.ecr.$AWS_REGION .amazonaws.com/$AWS_REPOSITORY : $TAG
85
86
echo " Docker Image published."
86
87
}
87
88
You can’t perform that action at this time.
0 commit comments