如何使用bitbucket-pipelines.yml文件在流水线中标记git提交?
以下是我的脚本。要使用它,您需要:
- 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
。