[英]How to configure automatic semantic versioning using ajoberstar/reckon and Bitbucket Pipelines?
我想设置一个自动语义版本控制,以便每个 CI 构建都会产生一个递增的补丁部分,例如……在 Bitbucket Pipelines 上进行设置。
我的理解是 ajoberstar/reckon 使用必须推送到原点的 git 标签工作。 使用以下 bitbucket-pipelines.yml 配置时失败。
options:
docker: true
pipelines:
branches:
master:
- step:
name: Build
image: openjdk:8-jdk
services:
- docker
caches:
- docker
- gradle
- gradlewrapper
size: 2x
script:
- ci/dependencies.sh
- ci/credentials.sh
- git remote set-url origin ${BITBUCKET_GIT_HTTP_ORIGIN}
- ./gradlew build reckonTagPush publish -Preckon.scope=patch -Preckon.stage=final
错误消息说:
Execution failed for task ':reckonTagPush'.
> org.eclipse.jgit.api.errors.TransportException: http://bitbucket.org/billtech/sync-manager: Authentication is required but no CredentialsProvider has been registered
根据: https : //community.atlassian.com/t5/Bitbucket-Pipelines-articles/Pushing-back-to-your-repository/ba-p/958407
配置备用 Git 客户端如果您不使用 Pipelines 提供的 git CLI,我们建议使用 ${BITBUCKET_GIT_HTTP_ORIGIN} 变量配置 origin。 如果使用 http 源,您还需要配置 git 客户端以使用代理。 代理 url 是: http://localhost:29418 。
我需要使用 Pipelines 提供的 git CLI 或为 reckon 使用的 git 客户端设置代理。 我无法让任何一个工作,所以任何帮助表示赞赏。
我最终拆分了以下内容:
- ./gradlew build reckonTagPush publish -Preckon.scope=patch -Preckon.stage=final
进入:
- ./gradlew build reckonTagCreate publish -Preckon.scope=patch -Preckon.stage=snapshot
- git push --tags
这样, reckon 仅用于创建标签,然后使用 git 命令推送它。 git 命令由 bitbucket 管道自动配置以推回到同一个 repo。 https://confluence.atlassian.com/bitbucket/push-back-to-your-repository-962352710.html
您需要通过设置此处列出的两个环境变量或系统属性来提供正确的凭据: http : //ajoberstar.org/grgit/grgit-authentication-2.html
使用系统属性的示例:
./gradlew build reckonTagPush publish -Preckon.scope=patch -Preckon.stage=final -Dorg.ajoberstar.grgit.auth.username=someone -Dorg.ajoberstar.grgit.auth.password=mysecretpassword
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.