我希望 travis 仅在我有特定的提交消息时才启动。
我怎样才能做到这一点。我的 travis.yml 文件是here https://github.com/mosaadm/mooltipass/blob/master/.travis.yml
我知道这里有一个条件question https://stackoverflow.com/questions/24679889/how-to-start-travis-ci-deploy-only-when-tag-name-matches-a-regex但我不知道该把它放在哪里。
The question https://stackoverflow.com/questions/24679889/how-to-start-travis-ci-deploy-only-when-tag-name-matches-a-regex您提到了关于部署 travis build 的问题。所以on:
条件仅决定是否部署构建。无论此设置如何,都会在每个提交/拉取请求上执行其他构建步骤。
你可以使用的是添加[ci skip]
or [skip ci]
强制提交消息构建跳过 https://docs.travis-ci.com/user/customizing-the-build/#Skipping-a-build.
您还可以使用TRAVIS_COMMIT_MESSAGE
默认环境变量 https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables在你所有的构建步骤 https://docs.travis-ci.com/user/customizing-the-build/#The-Build-Lifecycle确定是否应执行或跳过步骤,例如
script: if [[ $TRAVIS_COMMIT_MESSAGE == *"trigger build"* ]]; then mvn install ; fi ;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)