forked from camptocamp/ngeo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
148 lines (135 loc) · 4.97 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
dist: trusty
sudo: false
language: node_js
env:
global:
- CXX=g++-4.8
- secure: "l/McmiK4djffT04/+5MxW9sy4yO80Rf6vq+nZb5P647A6pXpPLdoRLGo50CtYRiKnFLiChHk2QxUOspeKuIKE+UQAm9dGmyMgfYkj/jwxIBd0YQqavaGzoWo5U1ZSGKeVd3kJlIaUJyLlnKbBOmFCY00c4JLveAagsV53lbephY="
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- google-chrome
packages:
- g++-4.8
- python-virtualenv
- google-chrome-stable
matrix:
include:
# Just do the tests
- node_js: "4"
env: >
DO_TEST=TRUE
DO_LINT=TRUE
- node_js: "6"
env: >
DO_TEST=TRUE
DO_LINT=TRUE
DO_NPM_DEPLOY=TRUE
DO_TRANSIFEX_DEPLOY=TRUE
# Test the examples in white space mode on the pull requests
- node_js: "6"
env: >
DEVELOPMENT=TRUE
DO_EXAMPLES_TEST=TRUE
EXAMPLES_SPLIT=1/2
DO_DIST_NGEO=TRUE
- node_js: "6"
env: >
DEVELOPMENT=TRUE
DO_EXAMPLES_TEST=TRUE
EXAMPLES_SPLIT=2/2
DO_DIST_GMF=TRUE
# Deploy the examples in advance mode on the commit on a branch
- node_js: "6"
env: >
DO_EXAMPLES_DEPLOY=TRUE
GIT_REMOTE_NAME=origin
GITHUB_USERNAME=camptocamp
EXAMPLES_NGEO=TRUE
- node_js: "6"
env: >
DO_EXAMPLES_DEPLOY=TRUE
GIT_REMOTE_NAME=origin
GITHUB_USERNAME=camptocamp
EXAMPLES_GMF=TRUE
- node_js: "6"
env: >
DO_EXAMPLES_DEPLOY=TRUE
GIT_REMOTE_NAME=origin
GITHUB_USERNAME=camptocamp
API=TRUE
APPS_GMF=TRUE
cache:
apt: true
directories:
- node_modules
install:
- npm prune
- if [ "${TRAVIS_PULL_REQUEST}" = false ]; then IS_PR=FALSE; else IS_PR=TRUE; fi
- if [ "${TRAVIS_PULL_REQUEST_SLUG}" == "camptocamp/ngeo" ] || [ "${TRAVIS_REPO_SLUG}${TRAVIS_PULL_REQUEST_SLUG}" == "camptocamp/ngeo" ]; then export IS_EXTERNAL=FALSE; else export IS_EXTERNAL=TRUE; fi
- echo $TRAVIS_REPO_SLUG
- echo $TRAVIS_PULL_REQUEST_SLUG
- echo $IS_EXTERNAL
- if [ ${TRAVIS_REPO_SLUG}-${IS_PR} = camptocamp/ngeo-FALSE ]; then openssl aes-256-cbc -K $encrypted_66d875d20fac_key -iv $encrypted_66d875d20fac_iv -in secrets.tar.enc -out secrets.tar -d; fi
- if [ ${TRAVIS_REPO_SLUG}-${IS_PR} = camptocamp/ngeo-FALSE ]; then tar xvf secrets.tar; fi
- if [ ${TRAVIS_REPO_SLUG}-${IS_PR} = camptocamp/ngeo-FALSE ]; then cp .transifexrc $HOME/.transifexrc; fi
- if [ ${TRAVIS_REPO_SLUG}-${IS_PR} = camptocamp/ngeo-FALSE ]; then cp ngeo_deploy_key $HOME/.ssh/id_rsa; fi
- if [ ${TRAVIS_REPO_SLUG}-${IS_PR} = camptocamp/ngeo-FALSE ]; then chmod 600 $HOME/.ssh/id_rsa; fi
- git config --global user.name "Travis"
- git config --global user.email "[email protected]"
- /opt/google/chrome/chrome --version
- export CHROME_BIN=/opt/google/chrome/chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- if [ "${IS_PR}" != "FALSE" ]; then git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}; fi
script:
- if [ "`git grep @fileoverview src contribs`" != "" ]; then echo "Using @fileoverview breaks the documentation main page"; FALSE; fi
- if [ "`git grep @example src contribs`" != "" ]; then echo "We don't use @example to have the example in the description"; FALSE; fi
- make git-attributes
- if [ "${DO_LINT}" = TRUE ]; then make lint; fi
- if [ "${DO_TEST}" = TRUE ]; then make test; fi
- if [ "${DO_EXAMPLES_TEST}-${IS_PR}" = TRUE-TRUE ]; then buildtools/test_examples.py ${EXAMPLES_SPLIT}; fi
- if [ "${DO_DIST_NGEO}-${IS_PR}" = TRUE-TRUE ]; then make dist/ngeo.js; fi
- if [ "${DO_DIST_NGEO}-${IS_PR}" = TRUE-TRUE ]; then make dist/ngeo-debug.js; fi
- if [ "${DO_DIST_GMF}-${IS_PR}" = TRUE-TRUE ]; then make dist/gmf.js; fi
- echo $TRAVIS_REPO_SLUG
- echo $TRAVIS_PULL_REQUEST_SLUG
- echo $IS_EXTERNAL
- echo "${DO_EXAMPLES_TEST}-${IS_EXTERNAL}"
- echo "${DO_DIST_NGEO}-${IS_EXTERNAL}"
- echo "${DO_DIST_NGEO}-${IS_EXTERNAL}"
- echo "${DO_DIST_GMF}-${IS_EXTERNAL}"
- if [ "${DO_EXAMPLES_DEPLOY}-${IS_PR}-${IS_EXTERNAL}" = TRUE-TRUE-TRUE ]; then echo 111; fi
- if [ "${DO_EXAMPLES_DEPLOY}-${IS_PR}-${IS_EXTERNAL}" = TRUE-TRUE-TRUE ]; then buildtools/deploy.sh; fi
- buildtools/travis-check
after_success:
- if [ "${DO_TEST}" = TRUE ]; then cat .build/coverage/lcov.info | node ./node_modules/coveralls/bin/coveralls.js; fi
- export GIT_BRANCH=${TRAVIS_BRANCH}
- echo "_auth = ${NPM_AUTH}" > ~/.npmrc
- echo "email = [email protected]" >> ~/.npmrc
- make .build/python-venv
- .build/python-venv/bin/pip install jsongrep
- export PACKAGE_VERSION=`.build/python-venv/bin/jsongrep -e version package.json`
deploy:
- provider: script
script: buildtools/deploy.sh
skip_cleanup: true
on:
repo: camptocamp/ngeo
all_branches: true
condition: '"${DO_EXAMPLES_DEPLOY}-${IS_PR}" = TRUE-FALSE'
- provider: script
script: npm publish
skip_cleanup: true
on:
repo: camptocamp/ngeo
tags: true
condition: '"${PACKAGE_VERSION}-${DO_NPM_DEPLOY}" = "${TRAVIS_TAG}-TRUE"'
- provider: script
script: make transifex-send
skip_cleanup: true
on:
repo: camptocamp/ngeo
branch: master
condition: '"${DO_TRANSIFEX_DEPLOY}" = TRUE'