-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
33 lines (27 loc) · 1.39 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
services:
- docker
language: node_js
node_js:
- node
before_script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- gcloud config set project 'default-docker-vm'
script:
- yarn build
- if [ "$BRANCH" == "master" ]; then yarn docker:build;
else echo "not master branch, skipping docker:build task"; fi
- if [ "$BRANCH" == "master" ]; then yarn docker:push;
else echo "not master branch, skipping docker:push task"; fi
- if [ "$BRANCH" == "master" ]; then ./google-cloud-sdk/bin/gcloud compute instances update-container docker --container-image=dimkinv/eve-discord-bot-test;
else echo "not master branch, skipping docker restart"; fi
before_install:
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH;
else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- openssl aes-256-cbc -K $encrypted_25de5cd8b217_key -iv $encrypted_25de5cd8b217_iv
-in credentials.tar.gz.enc -out credentials.tar.gz -d
- tar -xzf credentials.tar.gz
- wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-228.0.0-linux-x86_64.tar.gz > /dev/null
- tar xvzf google-cloud-sdk-228.0.0-linux-x86_64.tar.gz > /dev/null
- ./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file client-secret.json
- ./google-cloud-sdk/bin/gcloud config set project 'default-docker-vm'
- ./google-cloud-sdk/bin/gcloud config set compute/zone 'europe-west1-b'