我有一个包含两个分支的存储库:master和Dev我想以这样的方式配置该管道,当我将代码推送到Dev分支并且代码构建成功时,Dev被合并到master。不幸的是,我在 bitbucket piplines docs中找不到任何有关合并的信息。
那是我的 yml 文件:
pipelines:
branches:
Dev:
- step:
script:
- ant deployCodeCheckOnly -Dsf.username=$SF_USERNAME -Dsf.password=$SF_PASSWORD
有人可以帮我处理那个案子吗?如果可能的话?
- 编辑
我尝试将脚本更改为 sugest:
pipelines:
branches:
Dev:
- step:
script:
- ant deployCodeCheckOnly -Dsf.username=$SF_USERNAME -Dsf.password=$SF_PASSWORD
- git remote -v
- git fetch
- git checkout master
- git merge Dev
- git push -v --tags origin master:master
结果:
git remote -v
+ git remote -v
origin git@bitbucket.org:repository/project.git (fetch)
origin git@bitbucket.org:repository/project.git (push)
git fetch origin
+ git fetch origin
Warning: Permanently added the RSA host key for IP address ..... to the list of known hosts.
和错误:
+ git checkout master
error: pathspec 'master' did not match any file(s) known to git.
- 解决方案
Dev:
- step:
script:
- ant deployCodeCheckOnly -Dsf.username=$SF_USERNAME Dsf.password=$SF_PASSWORD
- git fetch
- git checkout -b master
- git merge Dev
- git push -v --tags origin master:master