-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
28 lines (28 loc) · 1.05 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
# .travis.yml
language: node_js # 前端工程所以是JavaScript,编译环境是node_js
git:
depth: 1
node_js:
- 'lts/*'
branchs:
only:
- master # 指定只有检测到master分支有变动时才执行git 任务
before_install:
- openssl aes-256-cbc -K $encrypted_04674a2f3de9_key -iv $encrypted_04674a2f3de9_iv
-in id_rsa.enc -out ~/.ssh/id_rsa -d
- chmod 600 ~/.ssh/id_rsa
install:
- npm i
script:
- npm run test
# - npm run build:doc
# - scp -r -o StrictHostKeyChecking=no build/ng-hertz-doc [email protected]:/www/wwwroot/ssr/panel/public
after_script:
- if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./node_modules/.bin/codecov; fi
# travis 默认当有 新 pr 提交时会触发任务,当为 pr 触发时不去服务器构建,因为下面执行的脚本里只构建 master 分支
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then who && ssh [email protected] -o StrictHostKeyChecking=no 'cd ~/ng-hertz && sh scripts/travis-deploy.sh'; fi
notifications:
email:
recipients:
on_failure: always