【发布时间】:2015-11-14 18:03:10
【问题描述】:
我有一个开源项目,我想部署代码,只要代码在主分支中,我已经尝试了很多方法,比如:
- if [[ $TRAVIS_BRANCH == 'master' ]]; then fab deploy; fi
或者类似的东西:
BRANCH = "master"
def _get_local_branch():
return local("git rev-parse --abbrev-ref HEAD", capture=True)
def deploy():
local_branch = _get_local_branch()
if local_branch == BRANCH:
print green("Deploy succefully done!")
print yellow("Deploy allowed just in the master branch.")
但这不起作用,即使在其他人的分支中,也触发了fab deploy命令。
【问题讨论】:
标签: python sh travis-ci fabric