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
1414# Preparate to install
1515before_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
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
2222
23+ # Install dependencies
2324install :
24- - npm i
25- - npm i coveralls
25+ - yarn install
26+ - yarn add coveralls
2627
2728# Lint the code
2829# Build a source code
2930before_script :
30- - npm run lint
31- - npm run build
31+ - yarn run lint
32+ - yarn run build
3233
34+ script :
3335# Run tests
36+ - yarn run travis:e2e
37+ - yarn run travis:test
38+
3439# Generate coverage info and deploy it to coveralls.io
40+ - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
41+
3542# Copy ci files for prevent errors when deploying
36- script :
37- - npm run travis:e2e
38- - npm run travis:test
39- - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
40- - cp .travis.yml ./dist
41- - cp -r .circleci ./dist
43+ - cp .travis.yml ./dist
44+ - cp -r .circleci ./dist
45+
46+ deploy :
47+ - on :
48+ branch : " src"
49+ provider : script
50+ skip_cleanup : true
51+ script :
52+ # Deploy semantic-release
53+ - npx semantic-release
4254
4355# 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+
4459# Build docker image and push it to hub
45- after_success :
46- - git remote add gitlab https://gitlab-ci-token:$GITLAB_TOKEN@gitlab.com/mpgp/mpgp.github.io.git
47- - git push gitlab src
48- - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
49- - docker build --rm --no-cache -t mpgp129/mpgpspec -f ./docker/Dockerfile .
50- - docker push mpgp129/mpgpspec
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
5163
5264# Deploy dist folder to master(gh-pages) branch
5365# https://github.com/settings/tokens
54- deploy :
55- provider : pages
56- skip_cleanup : true
57- github_token : $GITHUB_TOKEN
58- local_dir : dist
59- target-branch : master
60- email : torvalds@linux-foundation.org
61- name : Linus Torvalds
62- on :
63- branch : " src"
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
0 commit comments