11sudo : required
22language : node_js
33node_js :
4- - stable
4+ - stable
55addons :
6- chrome : stable
6+ chrome : stable
77cache :
8- directories :
9- - node_modules
8+ directories :
9+ - node_modules
1010branches :
11- only :
12- - src
11+ only :
12+ - src
1313
14- # Preparate to install
1514before_install :
16- - sudo chown root /opt/google/chrome/chrome-sandbox
17- - sudo chmod 4755 /opt/google/chrome/chrome-sandbox
18- - export CHROME_BIN=chromium-browser
19- - export DISPLAY=:99.0
20- - sh -e /etc/init.d/xvfb start
21- - echo TRAVIS_BRANCH = $TRAVIS_BRANCH
15+ - bash scripts/ci/1_before_install.sh
2216
23- # Install dependencies
2417install :
25- - yarn install
26- - yarn add coveralls
18+ - bash scripts/ci/2_install.sh
2719
28- # Lint the code
29- # Build a source code
3020before_script :
31- - yarn run lint
32- - yarn run build
21+ - bash scripts/ci/3_before_script.sh
3322
3423script :
35- # Run tests
36- - yarn run travis:e2e
37- - yarn run travis:test
38-
39- # Generate coverage info and deploy it to coveralls.io
40- - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
41-
42- # Copy ci files for prevent errors when deploying
43- - cp .travis.yml ./dist
44- - cp -r .circleci ./dist
24+ - bash scripts/ci/4_script.sh
4525
4626deploy :
47- - on :
48- branch : " src"
49- provider : script
50- skip_cleanup : true
51- script :
52- # Deploy semantic-release
53- - npx semantic-release
54-
55- # Sync github repo with gitlab
56- - git remote add gitlab https://gitlab-ci-token:$GITLAB_TOKEN@gitlab.com/mpgp/mpgp.github.io.git
57- - git push gitlab src
58-
59- # Build docker image and push it to hub
60- - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
61- - docker build --rm --no-cache -t mpgp129/mpgpspec -f ./docker/Dockerfile .
62- - docker push mpgp129/mpgpspec
27+ - on :
28+ branch : " src"
29+ provider : script
30+ skip_cleanup : true
31+ script :
32+ - BRANCH=$TRAVIS_BRANCH DOCKER_USERNAME=$DOCKER_USERNAME DOCKER_PASSWORD=$DOCKER_PASSWORD GITLAB_TOKEN=$GITLAB_TOKEN bash scripts/ci/5_deploy.sh
6333
6434# Deploy dist folder to master(gh-pages) branch
6535# https://github.com/settings/tokens
66- - on :
67- branch : " src"
68- provider : pages:
69- skip_cleanup : true
70- github_token : $GITHUB_TOKEN
71- local_dir : dist
72- target-branch : master
73- email : torvalds@linux-foundation.org
74- name : Linus Torvalds
36+ - on :
37+ branch : " src"
38+ provider : pages
39+ skip_cleanup : true
40+ github_token : $GITHUB_TOKEN
41+ local_dir : dist
42+ target-branch : master
43+ email : torvalds@linux-foundation.org
44+ name : Linus Torvalds
0 commit comments