Skip to content

Commit beb2490

Browse files
deshrajRishabhJain2018
authored andcommitted
Update docker configuration and optimize docker image size(#1860)
* Update docker configuration and optimize image size * Remove AWS_ACCOUNT_ID * Re-add containe name
1 parent 4912879 commit beb2490

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

.dockerignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
node_modules
21
bower_components
32
env
3+
elasticmq-server-0.14.2.jar
4+
examples
45
media
6+
node_modules
7+
static

scripts/deploy/deploy.sh

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
#!/bin/bash
22
set -e
33

4+
export COMMIT_ID=$(git rev-parse HEAD)
5+
46
build_and_push() {
57
aws configure set default.region us-east-1
68
eval $(aws ecr get-login --no-include-email)
79
docker-compose -f docker-compose-$1.yml build
810
docker-compose -f docker-compose-$1.yml push
911

10-
# Get the build docker images
12+
# Get already built docker images
1113
images=$(cat docker-compose-$1.yml | grep 'image: ' | cut -d':' -f 2 | tr -d '"')
1214

13-
# It is used to tag & push the images with latest tag
15+
# Tag & push images with latest tag
1416
for image in $images
1517
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
1821
done
1922
}
2023

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

0 commit comments

Comments
 (0)