-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
47 lines (40 loc) · 1.6 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
sudo: required
language: generic
services:
- docker
before_install:
- echo "$GP_PASSWORD" | docker login docker.pkg.github.com -u "$GP_USERNAME" --password-stdin
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > /tmp/cc-test-reporter
- chmod +x /tmp/cc-test-reporter
- if [[ "$WV_BRANCH_NAME" = "develop" ]] ; then export WV_BRANCH_NAME=; fi
- touch .env
- docker-compose pull || WV_BRANCH_NAME= docker-compose pull || true
before_script:
- mkdir -p $(dirname "$REACT_STORE_DIR")
- git clone https://github.com/toggle-corp/react-store --branch wv-release-v2 ${REACT_STORE_DIR}
- git --git-dir=$REACT_STORE_DIR/.git --no-pager show --pretty=fuller --quiet
- docker-compose build
- /tmp/cc-test-reporter before-build
script:
- docker-compose run --rm server bash /code/scripts/run_tests.sh
- echo "
REACT_APP_MAPBOX_ACCESS_TOKEN=${REACT_APP_MAPBOX_ACCESS_TOKEN}
REACT_APP_MAPBOX_STYLE=${REACT_APP_MAPBOX_STYLE}
" > .env
# Instead of Test
- docker-compose run --rm client bash -c 'rsync -a --stats --ignore-existing /node_modules /code/ && yarn install && CI=false yarn build'
after_success:
- docker-compose push
- cd server && /tmp/cc-test-reporter after-build --prefix ./server -t coverage.py --exit-code $TRAVIS_TEST_RESULT && cd ../
deploy:
provider: pages
skip_cleanup: true
github_token: $GP_PASSWORD
keep_history: true
local_dir: ./server/htmlcov
on:
branch: develop
env:
global:
- REACT_STORE_DIR=client/src/vendor/react-store
- WV_BRANCH_NAME=`echo ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} | tr / _`