-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path.travis.yml
50 lines (49 loc) · 2.13 KB
/
.travis.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
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
language: node_js
dist: xenial
node_js:
- "10.14.1"
sudo: true
git:
depth: 1
before_install:
- sudo apt-get -qq update
- sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev gcc-4.8 g++-4.8 build-essential -y
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.12.3
- export PATH="$HOME/.yarn/bin:$PATH" CXX=g++-4.8
- yarn cache clean
- yarn
branches:
only:
- master
- develop
- release
jobs:
include:
- stage: lint
script:
- yarn lint:errors
- stage: build
script:
- yarn build --production
- stage: deploy
if: (NOT type IN (pull_request))
before_script:
- FULL_GCR_KEY="-----BEGIN PRIVATE KEY-----\n"$GCR_KEY"\n-----END PRIVATE KEY-----\n"
- sed -i -e "s%\PWD%$FULL_GCR_KEY%g" gcregistry.json
- sed -i -e "s%branch%$TRAVIS_BRANCH%g" Dockerfile
- cat Dockerfile
- docker login -u _json_key -p "$(cat gcregistry.json)" https://gcr.io
- rm -rf gcregistry.json
- IMAGE_TAG_NAME="latest"
script:
- |
if [ "$TRAVIS_BRANCH" == "master" ]; then
docker build --build-arg BUILD_BRANCH="master" --build-arg PUBLIC_BACKEND_REST_URL="https://backend.chronobank.io" --build-arg NODE=production -t gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME . --no-cache
docker push gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME
elif [ "$TRAVIS_BRANCH" == "develop" ]; then
docker build --build-arg BUILD_BRANCH="develop" --build-arg PUBLIC_BACKEND_REST_URL="https://stage-adm.chronobank.io" -t gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME . --no-cache
docker push gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME
elif [ "$TRAVIS_BRANCH" == "release" ]; then
docker build --build-arg BUILD_BRANCH="release" --build-arg PUBLIC_BACKEND_REST_URL="https://backend.chronobank.io" -t gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME . --no-cache
docker push gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME
fi;