forked from Jigsaw-Code/outline-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
103 lines (93 loc) · 4.46 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
language: node_js
node_js:
- "12"
cache:
yarn: true
directories:
- $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"
# Install latest Docker for BuildKit support if running on linux. See https://docs.travis-ci.com/user/docker/
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
fi;
stages:
- name: "Server Daily Release"
if: type = cron
- name: "Deploy Server"
if: tag =~ ^server-
- name: "Manager Release"
if: tag =~ ^v[0-9]
# Stages with the same name define multiple jobs which run in parallel.
jobs:
include:
- stage: "Server Daily Release"
script:
- CREATE_RELEASE_URL=https://api.github.com/repos/Jigsaw-Code/outline-server/releases?access_token=$CI_USER_TOKEN
- SERVER_RELEASE_NAME=server-$(date -I)
- curl --data '{"tag_name":"'$SERVER_RELEASE_NAME'","name":"'$SERVER_RELEASE_NAME'","prerelease":true}' $CREATE_RELEASE_URL
- MANAGER_RELEASE_NAME=v$(date -I)
- curl --data '{"tag_name":"'$MANAGER_RELEASE_NAME'","name":"'$MANAGER_RELEASE_NAME'","prerelease":true}' $CREATE_RELEASE_URL
- stage: "Deploy Server"
name: Server Testing
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.25.5/docker-compose-$(uname -s)-$(uname -m) > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
- yarn do shadowbox/test
- yarn do shadowbox/docker/build && cd src/shadowbox/integration_test && ./test.sh
- stage: "Deploy Server"
name: Server 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
# Note that because we cannot currently sign Windows binaries on Travis,
# these must be manually built and uploaded to the releases page.
- stage: "Manager Release"
name: Manager Linux
addons:
apt:
packages:
- rpm
script: yarn do server_manager/electron_app/release_linux
- stage: "Manager Release"
os: osx
# electron-builder requires macOS >=10.13.6 for signing to work.
osx_image: xcode10.1
name: Manager macOS
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