generated from kalisio/skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.app.sh
50 lines (37 loc) · 1.17 KB
/
.travis.app.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#
# Provision the required files
#
travis_fold start "provision"
source .travis.env.sh
travis_fold end "provision"
#
# Build the app
#
travis_fold start "build"
yarn pwa:build
EXIT_CODE=$?
check_code $EXIT_CODE 0 "Builing the client"
# Log in to docker before building the app because of rate limiting
docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD"
check_code $? 0 "Connecting to Docker"
# Create an archive to speed docker build process
cd ../..
tar --exclude='$APP/test' -zcf $TRAVIS_BUILD_DIR/kalisio.tgz kalisio
# Build the image
cd $TRAVIS_BUILD_DIR
docker build --build-arg APP=$APP --build-arg FLAVOR=$FLAVOR --build-arg BUILD_NUMBER=$BUILD_NUMBER -f dockerfile -t kalisio/$APP:$TAG .
check_code $? 0 "Building the app docker image"
travis_fold end "build"
#
# Deploy the app
#
travis_fold start "deploy"
# Push the app image to the hub with the version tag
docker push kalisio/$APP:$TAG
check_code $? 0 "Pushing the $APP:$TAG docker image"
# Push the app image to the hub with the flavor tag
docker tag kalisio/$APP:$TAG kalisio/$APP:$FLAVOR
docker push kalisio/$APP:$FLAVOR
check_code $? 0 "Pushing the $APP:$TAG docker image"
travis_fold end "deploy"