[未完待续]html
最后,咱们来到最简单的使用travis进行自动发布。java
在根目录添加.travis.yml
文件git
# 声明使用语言 language: java # 声明JDK版本 jdk: - oraclejdk8 # travis升级后,增长该选项 group: edge # 声明使用的服务 services: - docker # 通知方式 notifications: email: false webhooks: https://oapi.dingtalk.com/robot/send?access_token=15601e3b5602c662d2db4d4a5dc89600435114c4fcfbcfaccb3fcc1ff5437ad8 # 脚本 script: # - grunt test - cd app/newApi - java -version - javac -version - mvn test # 声明缓存 cache: directories: - .autoconf - $HOME/.m2 # 脚本执行成功后,进入文档文件夹,并强行push到项目的gh-page分支,生成项目文档 after_success: - cd target/asciidoc/html - git init - git config user.name "${GH_USER_NAME}" - git config user.email "{GH_USER_EMAIL}" - git add . ; git commit -m "Deploy to GitHub Pages" - git status - git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages
打开github, 点右上角图标,来到我的中心。
而后点击左下解的:github
私有项目,访问:https://travis-ci.com/
公有项目,访问:https://travis-ci.org/web
找到要启用的项目,点击。docker
点击启用。api
点击后,点 setting
缓存
github
Settings
-> Branches
好比咱们当前设置的为保护master
分支。oracle
点击修改其策略。app