forked from Trustroots/trustroots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
70 lines (70 loc) · 2.89 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
language: node_js
# run for only for pull requests or master branch
if: 'type = pull_request OR branch = master'
matrix:
fast_finish: true
# Generally using active LTS versions here, see https://github.com/nodejs/Release
include:
- name: Test client
node_js: 12
env: RUN="npm run test:client"
- name: Test server
node_js: 12
env: RUN="npm run test:server"
- name: Lint and build
node_js: 12
env: RUN="npx concurrently --kill-others-on-fail 'npm:lint' 'npm:build:tarball'" DEPLOY="true"
# https://docs.travis-ci.com/user/reference/overview/#Virtualisation-Environment-vs-Operating-System
script: '$RUN'
install: npm ci
dist: bionic
services:
- mongodb
- docker
addons:
apt:
packages:
- graphicsmagick
before_script:
- mongo --version
- mongod --version
# Ensure stable NPM version (avoids `-next.0` tags)
- npm install -g npm
- ./scripts/ci/update-locales
- './scripts/ci/fix-weblate public/locales/*/*.json'
cache:
directories:
- '$HOME/.node-gyp'
- '$HOME/.npm'
# https://docs.travis-ci.com/user/deployment-v2
before_deploy:
- sha256sum trustroots.tar.gz > trustroots.tar.gz.sha256
deploy:
# this creates a tarball from the built files and uploads it to DigitalOcean spaces
# it is then available publically at https://trustroots-builds.fra1.digitaloceanspaces.com/trustroots.tar.gz
edge: true # opt in to use deployments v2
provider: s3
access_key_id: C6VPVZTPB2LWSGECOJAV
secret_access_key:
secure: KZ/M6Nnn3raktHWjYs0ddoRS/1ojfQpBXKiqroJMh1k2qy07j/GM5j/CKZH+aJGB5AU9QxKahF+zrQs2Gh5Uo3Uoo9gpVGUxqTb2Ok57zUBw3lywTbYCliisIpSA+NPLCzEI/C82Db603wk8yiD8TJyZCTPWFUyhGNUVKSy4Y/w=
bucket: trustroots-builds
endpoint: https://fra1.digitaloceanspaces.com
glob: 'trustroots.tar.gz*'
acl: public_read
verbose: true
# https://docs.travis-ci.com/user/deployment-v2/conditional
on:
branch: master
condition: "$DEPLOY == 'true'" # only run for the build job
after_deploy:
# deploy the tarball to the dev site
# runs the debops trustroots/deploy playbook from https://github.com/trustroots/trustroots-debops
# using the docker image built here https://hub.docker.com/repository/docker/trustroots/trustroots-debops
- openssl aes-256-cbc -K $encrypted_67cd8b498c7f_key -iv $encrypted_67cd8b498c7f_iv -in deploy/debops/files/id_ed25519_trustroots_deploy_2020-03-02.enc -out deploy/debops/files/id_ed25519_trustroots_deploy_2020-03-02 -d
- ./deploy/debops/deploy deploy deploy/debops/files/id_ed25519_trustroots_deploy_2020-03-02
notifications:
slack:
secure: XRMYG9Hf+bJjMSHHXN0XeGT4ZhSP+oCHBUWmjBwxO0p+VORBOEZvlh/2OvxingFuzLGOXFeOPr1g91G+OgiCGR6GxaDpf680lEjk8ESTJ4oECv0aO2NQEZWYR4peiLRtBmJZTCSsKXDY21nrDHiKOaMQyPJqbzkIrTBMnK/YJpg=
env:
global:
secure: tgHqZxeXzjT4eF0+Q+JFM7CfNFHuk9IEVq/dxQYPgMqBy28/z3o+GHCyx/llt6ZwLQrRYQY3kAwq/hTuAClT0YZSKukRgWCVXtQ6r77gr3JnTc6Ry9Dvz0fy90KxDCbpqPKKvAvndNrZkHz3t4ateHcGlTXcHAgQMy2mKk+OSPo=