File tree Expand file tree Collapse file tree 2 files changed +12
-17
lines changed Expand file tree Collapse file tree 2 files changed +12
-17
lines changed Original file line number Diff line number Diff line change 1
- node_modules
2
1
bower_components
3
2
env
3
+ elasticmq-server-0.14.2.jar
4
+ examples
4
5
media
6
+ node_modules
7
+ static
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
4
+ export COMMIT_ID=$( git rev-parse HEAD)
5
+
4
6
build_and_push () {
5
7
aws configure set default.region us-east-1
6
8
eval $( aws ecr get-login --no-include-email)
7
9
docker-compose -f docker-compose-$1 .yml build
8
10
docker-compose -f docker-compose-$1 .yml push
9
11
10
- # Get the build docker images
12
+ # Get already built docker images
11
13
images=$( cat docker-compose-$1 .yml | grep ' image: ' | cut -d' :' -f 2 | tr -d ' "' )
12
14
13
- # It is used to tag & push the images with latest tag
15
+ # Tag & push images with latest tag
14
16
for image in $images
15
17
do
16
- docker tag " ${image} " :" $2 " " ${image} " :" latest"
17
- docker push " ${image} " :" latest"
18
+ eval image=${image}
19
+ docker tag ${image} :${COMMIT_ID} ${image} :latest
20
+ docker push ${image} :latest
18
21
done
19
22
}
20
23
21
- if [ " ${TRAVIS_PULL_REQUEST} " != " false" ]; then
22
- echo " Skipping deploy to staging or production server; The request or commit is not on staging or production branch"
23
- exit 0
24
-
25
- elif [ " ${TRAVIS_BRANCH} " == " staging" -o " ${TRAVIS_BRANCH} " == " production" ]; then
26
- build_and_push $TRAVIS_BRANCH $TRAVIS_COMMIT
27
- exit 0
28
-
29
- else
30
- echo " Skipping deploy!"
31
- exit 0
32
- fi
24
+ build_and_push $1
You can’t perform that action at this time.
0 commit comments