forked from ClearGDPR/ClearGDPR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (52 loc) · 1.95 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
53
54
55
sudo: required
language: node_js
node_js:
- '8'
cache:
yarn: true
directories:
- $HOME/.yarn_cache
before_install:
- sudo /etc/init.d/postgresql stop
- pip install --user awscli
- openssl aes-256-cbc -K $encrypted_1f8d325dded8_key -iv $encrypted_1f8d325dded8_iv -in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
- travis/restore_yarn_cache.sh
before_cache:
- travis/prepare_yarn_cache.sh
services:
- docker
env:
- VERSION: $TRAVIS_TAG
stages:
- test
- publish
- deploy
jobs:
include:
- stage: test # Run the tests
script:
- make -C admin dist || travis_terminate 1
- make -C frontend dist || travis_terminate 1
- docker/test
- stage: publish # Publish images to Docker Hub
if: tag =~ ^(\d*\.)+\d*$
script:
- touch cg/.yarn-cache.tgz admin/.yarn-cache.tgz api/.yarn-cache.tgz frontend/.yarn-cache.tgz
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- echo "Building and pushing docker images v$VERSION"
- travis/publish.sh || travis_terminate 1
- stage: deploy # Creates a kubeDef.json file and deploys it using kubernetes
if: tag =~ ^(\d*\.)+\d*$
script:
- cd website && yarn && NODE_ENV=production yarn build && cd ..
- echo "Deploying version v$VERSION"
- node travis/generate-kubedef.js --quorum1
- "curl -X POST --data \"@kubeDef.json\" -H \"x-api-key: $LAMBDA_TOKEN\" $LAMBDA_URL"
- node travis/generate-kubedef.js --quorum2
- "curl -X POST --data \"@kubeDef.json\" -H \"x-api-key: $LAMBDA_TOKEN\" $LAMBDA_URL"
- node travis/generate-kubedef.js --back-end
- "curl -X POST --data \"@kubeDef.json\" -H \"x-api-key: $LAMBDA_TOKEN\" $LAMBDA_URL"
- node travis/generate-kubedef.js --front-end
- "curl -X POST --data \"@kubeDef.json\" -H \"x-api-key: $LAMBDA_TOKEN\" $LAMBDA_URL"
- ./travis/deploy-static-sites.sh