如何使用Bitbucket Pipelines(Bitbucket Pipelines.yml)发布git标记



如何使用bitbucket-pipelines.yml文件在管道中标记git提交?

下面是我的脚本。要使用它,您需要

  1. 在Repo中添加SSH密钥->设置->管道->SSH密钥
  2. 公钥添加到团队或您配置SSH密钥
- step: &tag
name: Tag version
image: atlassian/default-image:2
script:
- git remote set-url origin ${BITBUCKET_GIT_SSH_ORIGIN}
- dt=$(date '+%Y-%m-%d_%H%M');
- git tag $dt ${BITBUCKET_COMMIT}
- git push origin --tags

这里有管道git授权的完整文档:https://confluence.atlassian.com/bitbucket/push-back-to-your-repository-962352710.html

最新更新