forked from open-learning-exchange/planet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
153 lines (147 loc) Β· 6.69 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
149
150
151
152
153
_prepare_deploy: &_prepare_deploy
before_script:
- source ./.travis/travis_utils.sh
- login_docker
- prepare_everything
- docker pull $PLANET_TEST
- docker pull $DOCKER_DB_INIT_TEST
_prepare_multiarch: &_prepare_multiarch
before_script:
- source ./.travis/travis_utils.sh
- login_docker
- prepare_everything
- prepare_yq
- prepare_multiarch_manifest_tool
- prepare_db_init_rpi
- prepare_planet_rpi
_use_chrome: &_use_chrome
addons:
chrome: stable
_use_nodejs: &_use_nodejs
language: node_js
node_js:
- "10"
sudo: required
dist: xenial
branches:
except:
- l10n_master
services:
- docker
env:
global:
# DOCKER_USER
- secure: "V/U6r8NEg46zbazfEyPJaSjMONaGRlzd5QeJQpqxnf+KSkC8rkkxTh8/LW7k3emGmXnqdSRtQ9keShKo1fb7qJpTxvFuK2YspEmSB69pAxxRj3C+3ikXSz5bM1VHtzC96T+eXzxug6/qAEgWR/OM3aD9GJC14R7sdv5dKxneFgJDZO2nB7pLsU19EYyPdsi4NQt11GQy/vCwYF2qEdWWo7SUmkI6DTQvdyu/dSulID0cfiBUvHcB4A3nMeewEjAY0KFKOr3zcKX6FJ5zKF47r/A/LYF25TtNRfJFvh5txkJFu3HlFSY7FEukB6eOdmqN5jm1omZd+yESzvp5Fm6q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ules
stages:
- docker-creation
- automated-test-and-compose-languages
- docker-release
- multiarch-release
jobs:
include:
- stage: docker-creation
name: "English"
script:
- bash ./.travis/deploy_single_language.sh 'eng' 'en'
- stage: docker-creation
if: tag = branch
name: "Arabic"
script:
- bash ./.travis/deploy_single_language.sh 'ara' 'ar'
- stage: docker-creation
if: tag = branch
name: "French"
script:
- bash ./.travis/deploy_single_language.sh 'fra' 'fr'
- stage: docker-creation
if: tag = branch
name: "Spanish"
script:
- bash ./.travis/deploy_single_language.sh 'spa' 'es'
- stage: docker-creation
if: tag = branch
name: "Nepali"
script:
- bash ./.travis/deploy_single_language.sh 'nep' 'ne'
- stage: docker-creation
if: tag = branch
name: "Somali"
script:
- bash ./.travis/deploy_single_language.sh 'som' 'so'
- stage: docker-creation
script:
- set -e
- source ./.travis/travis_utils.sh
- prepare_ci
- prepare_db_init_test
- deploy_docker './docker/db-init/Dockerfile' $DOCKER_DB_INIT_TEST $DOCKER_DB_INIT_TEST_LATEST
- stage: automated-test-and-compose-languages
<<: *_use_chrome
<<: *_use_nodejs
services:
- xvfb
before_install:
- source ./.travis/travis_utils.sh
- prepare_ci
- prepare_planet_test
- prepare_db_init_test
- render_compose_travis
- nohup docker-compose -f ./.travis/planet-travis.yml up &
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm
&& git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh
&& nvm install $TRAVIS_NODE_VERSION
before_script:
- travis_retry npm install
- travis_retry npm install -g @angular/cli
- travis_retry npm install -g karma
script:
- set -e
- echo "Waiting for couchdb to finish initialization"; until [ $(docker ps -aq --filter "name=db-init" --filter "status=exited" | wc -c) -gt 0 ] || [ $WAIT_TIME -eq 600 ]; do echo "..."; sleep 5; WAIT_TIME=$(expr $WAIT_TIME + 5); done
- i=$(curl -X GET http://127.0.0.1:5984/_all_dbs | jq length); if [ $i -ne 40 ]; then exit 1; fi
- webdriver-manager update --versions.chrome=$(google-chrome --version | cut -d ' ' -f 3)
- npm run e2e
- stage: automated-test-and-compose-languages
script:
- bash ./.travis/deploy_planet.sh
- stage: docker-release
<<: *_prepare_deploy
script: #x86 tagging
- set -e
- tag_docker $PLANET_TEST $PLANET $PLANET_LATEST
- tag_docker $DOCKER_DB_INIT_TEST $DOCKER_DB_INIT $DOCKER_DB_INIT_LATEST
- push_docker $PLANET $PLANET_LATEST
- push_docker $DOCKER_DB_INIT $DOCKER_DB_INIT_LATEST
- deploy_tag $PLANET_TEST $PLANET_VERSIONED
- deploy_tag $DOCKER_DB_INIT_TEST $DOCKER_DB_INIT_VERSIONED
- docker logout
- stage: docker-release
script: #arm image building planet
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- travis_wait 45 bash ./.travis/deploy_rpi.sh --branch="$TRAVIS_BRANCH" --commit="$TRAVIS_COMMIT" --pull="$TRAVIS_PULL_REQUEST" --duser="$DOCKER_USER" --dpass="$DOCKER_PASS" --gtag="$TRAVIS_TAG" --image=planet
- stage: docker-release
script: #arm image building planet
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- travis_wait 45 bash ./.travis/deploy_rpi.sh --branch="$TRAVIS_BRANCH" --commit="$TRAVIS_COMMIT" --pull="$TRAVIS_PULL_REQUEST" --duser="$DOCKER_USER" --dpass="$DOCKER_PASS" --gtag="$TRAVIS_TAG" --image=db-init
- stage: multiarch-release
<<: *_prepare_multiarch
script: #Pushing multiarch
- set -e
- create_multiarch_manifest_planet $PLANET_RPI_LATEST $PLANET_LATEST $PLANET_RPI_VERSIONED $PLANET_VERSIONED
- create_multiarch_manifest_dbinit $DOCKER_DB_INIT_RPI_LATEST $DOCKER_DB_INIT_LATEST $DOCKER_DB_INIT_RPI_VERSIONED $DOCKER_DB_INIT_VERSIONED
- push_multiarch_manifests
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/063276d3941fa8443947
on_success: always # options: [always|never|change] default: change
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: never