-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
52 lines (52 loc) · 1.96 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
51
52
sudo: required
language: node_js
node_js:
- '9'
services:
- docker
branches:
only:
- master
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
- /^v[0-9]+\.[0-9]+\.[0-9]+-staging$/
jobs:
include:
- stage: build
if: branch = master
install: skip
script:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker build --tag pyrrha_boxplorer .
- docker images
- stage: build_prod
if: branch =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
install: skip
script:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker build --tag pyrrha_boxplorer .
- docker images
- docker tag pyrrha_boxplorer pandoraboxchain/pyrrha_boxplorer:latest
- docker push pandoraboxchain/pyrrha_boxplorer:latest
- stage: build_staging
if: branch =~ /^v[0-9]+\.[0-9]+\.[0-9]+-staging$/
install: skip
script:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker build --build-arg REACT_APP_BOXPROXY_HOST=boxproxy.staging.pandora.network --tag pyrrha_boxplorer .
- docker images
- docker tag pyrrha_boxplorer pandoraboxchain/pyrrha_boxplorer:staging
- docker push pandoraboxchain/pyrrha_boxplorer:staging
- stage: deploy_prod
if: branch =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
install: skip
script:
- openssl aes-256-cbc -K $encrypted_d7f89b072dc3_key -iv $encrypted_d7f89b072dc3_iv -in key.enc -out key -d
- chmod 600 ./key
- ssh -o "StrictHostKeyChecking no" -i ./key [email protected] -tt 'bash -s' < ./deploy.sh
- stage: deploy_staging
if: branch =~ /^v[0-9]+\.[0-9]+\.[0-9]+-staging$/
install: skip
script:
- openssl aes-256-cbc -K $encrypted_d7f89b072dc3_key -iv $encrypted_d7f89b072dc3_iv -in key.enc -out key -d
- chmod 600 ./key
- ssh -o "StrictHostKeyChecking no" -i ./key [email protected] -tt 'bash -s' < ./deploy-staging.sh