forked from Jigsaw-Code/outline-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
148 lines (133 loc) · 5.47 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
language: node_js
node_js:
- "10"
cache:
yarn: true
directories:
- $HOME/.cache/bower
- $HOME/.cache/electron
- $HOME/.cache/electron-builder
before_install:
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Travis-CI-supports-yarn
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.12.3
- export PATH="$HOME/.yarn/bin:$PATH"
stages:
- name: tag
if: type = cron
- name: build and unit test
if: type != cron
- name: integration test
if: type != cron
- name: deploy
if: tag =~ ^daily
- name: release
if: tag =~ ^v[0-9]
# Stages with the same name define multiple jobs which run in parallel.
# To make it more apparent in the Travis UI exactly what each job is
# doing, we add a descriptive environment variable.
jobs:
include:
- stage: tag
script:
- RELEASE_NAME=daily-$(date -I)
- curl --data '{"tag_name":"'$RELEASE_NAME'","name":"'$RELEASE_NAME'","prerelease":true}' https://api.github.com/repos/Jigsaw-Code/outline-server/releases?access_token=$CI_USER_TOKEN
# Ideally, we would split this stage in some way, e.g. by component or by
# build/test commands, to make it clearer in the Travis UI exactly which
# command failed. However, since each stage incurs a significantly start-up
# cost, we combine test and build commands for all components into one fast
# stage.
- stage: build and unit test
script:
- yarn do metrics_server/build
- yarn do sentry_webhook/build
- yarn do shadowbox/server/build
- yarn do shadowbox/test
- yarn do server_manager/electron_app/build
- yarn do server_manager/electron_app/test
- yarn do server_manager/web_app/build
- yarn do server_manager/web_app/test
- stage: integration test
sudo: required
services: docker
script:
# https://docs.travis-ci.com/user/docker/
- |
sudo rm -f /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/1.17.1/docker-compose-$(uname -s)-$(uname -m) > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
- yarn do shadowbox/integration_test/run
- stage: deploy
env:
- DESC=shadowbox docker image
sudo: required
services: docker
script:
- yarn do shadowbox/docker/build
- docker login quay.io -u="$QUAY_IO_USERNAME" -p="$QUAY_IO_PASSWORD"
- docker tag outline/shadowbox quay.io/outline/shadowbox:$TRAVIS_TAG
- docker push quay.io/outline/shadowbox:$TRAVIS_TAG
- docker tag outline/shadowbox quay.io/outline/shadowbox:daily
- docker push quay.io/outline/shadowbox:daily
- stage: deploy
env:
- DESC=linux manager
addons:
apt:
packages:
- rpm
script: yarn do server_manager/electron_app/package_linux
# https://www.electron.build/multi-platform-build
- stage: deploy
env:
- DESC=windows manager
sudo: required
services: docker
script:
- yarn do server_manager/electron_app/build
- docker pull electronuserland/builder:wine
- docker run --rm
-v ${PWD}:/project
-v ~/.cache/electron:/root/.cache/electron
-v ~/.cache/electron-builder:/root/.cache/electron-builder
electronuserland/builder:wine
/bin/bash -c "yarn do server_manager/electron_app/package_only_windows" || travis_terminate $?
- stage: deploy
env:
- DESC=macos manager
os: osx
script: yarn do server_manager/electron_app/package_macos
# Note that because we cannot currently sign Windows binaries on Travis,
# these must be manually built and uploaded to the releases page.
- stage: release
env:
- DESC=linux manager
addons:
apt:
packages:
- rpm
script: yarn do server_manager/electron_app/release_linux
- stage: release
os: osx
# electron-builder requires macOS >=10.13.6 for signing to work.
osx_image: xcode10.1
env:
- DESC=macos manager
script:
- openssl aes-256-cbc -K $encrypted_61a49da75942_key -iv $encrypted_61a49da75942_iv -in macos-signing-certificate.p12.enc -out macos-signing-certificate.p12 -d
- export CSC_LINK=$(pwd)/macos-signing-certificate.p12
# Must run yarn again due to the OS change, required for signing to work.
- yarn && yarn do server_manager/electron_app/release_macos
deploy:
provider: releases
api_key:
secure: "0uQ8HgYBpzeXG+m/q6FUrcvQe+30YkbuGej/nT4mAj9VhX7Ft/5PdsB6lFiUjc/OnNLbaMdIHJj2MO5SDy55A4d5gC/LN4hcvwWKY+sRephyMnu3f0Nepy1bZbA1rud4MToSv7K3aD24f7AWNNiwz8f/CdvENt6fDu53GuPZLPUDR6TzMy1JBZ3jyLDpy7Cjue24B9XUaXWzBpwFD1TpeKJ37O5V655+VWWPuYWUY2or0N6Iohunhrp1IhQAM7Cw4zln94prXmdX9bux8OP6U73gnyvTf7eGG4SjzypqqCL7VzqzUmDqYm072t2jvTwtjWjUt0vTE4UfOituDBK8VXqIpa4GGk3HBbx40GEQxVXJNCJl48cZsmEPZB+w4mPgxO9EWA/SpBNloqJuvfbspczYgvrM1/p5169PcXScVF+6iV+EWUeMKrymXOmJ4LpjttCDCTg/3AfwHCbAD+4JuLLMETfWeeZQ/4w3HBwxRRUFyvryLHmshuCahJxICWeJMtxftkA3O8e9Kc6P6x/G0JKDrSLeNJcY4vyKwpe4R9uJWk0A5lAnklFKgSXNT394/TNXpuTXuarZD6VaJcx9ieBQNkzpmi9RoLTjdnigmYeTWdPFrhOP/0fJu05U3nyH0NpKscG0e3+kG0XTJOHhYSwp/UknZb4rfR+BmqSTGik="
file_glob: true
file: "build/server_manager/electron_app/static/dist/*.*"
skip_cleanup: true
on:
tags: true
env:
global:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder