如何在Bitbucket Pipelines(bitbucket-pipelines.yml)中打git标签发布

7
如何使用bitbucket-pipelines.yml文件在流水线中标记git提交?
1个回答

11

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

  1. 在存储库 -> 设置 -> 流水线 -> 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

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接