仅使用特定提交消息来触发travis CI构建 [英] trigger travis CI build only with specific commit message

查看:101
本文介绍了仅使用特定提交消息来触发travis CI构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅当我有certian提交消息时,我才希望travis开始. 我怎样才能做到这一点.我的travis.yml文件是此处

I want travis to start only if I have a certian commit message. how can i do this. My travis.yml file is here

我知道此

I know there is an on condition from this question but I dont know where to put it.

推荐答案

The question you mentioned regards deploying travis build. So on: condition only determines if build is deployed or not. Regardless this setting other build steps are executed on each commit/pull request.

您可以改用的是在提交消息中添加[ci skip][skip ci]来强制

What you could use instead is adding [ci skip] or [skip ci] in commit messages to force build skipping.

您还可以使用TRAVIS_COMMIT_MESSAGE 默认环境变量在您的所有构建步骤中确定是应该执行还是跳过步骤,例如

You can also use TRAVIS_COMMIT_MESSAGE default env variable in all your build steps to determine if step should be executed or skipped, e.g.

 script: if [[ $TRAVIS_COMMIT_MESSAGE == *"trigger build"* ]]; then mvn install ; fi ;

这篇关于仅使用特定提交消息来触发travis CI构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆