git - 蓝调 : How I can configure a delivery pipeline stage build to tag git?

标签 git ibm-cloud pipeline devops

我在 Bluemix 中有一个构建和部署管道,如果该阶段已成功部署,我想标记 git。 目前,我在部署阶段之后添加了一个构建步骤,其中的 shell 脚本如下所示:

# put the git tag
echo 'Put tag build_$BUILD_NUMBER on git'
git tag build_$BUILD_NUMBER
git push --tags

返回的错误是:

fatal: could not read Username for 'https://hub.jazz.net': No such device or address Build step 'Execute shell' marked build as failure

但是我似乎没有.gitcredentials 文件可以推送而不需要添加身份验证信息。

如何将 git 上的标签推送到我的交付管道中?

最佳答案

您需要输入远程 URL 的用户名和密码。我过去测试过以下内容并且对我有用:

 git remote set-url origin https://$USERNAME:$PASSWORD@hub.jazz.net/git/user/project

其中 USERNAME 和 PASSWORD 是舞台上的环境属性。我建议将密码设置为安全属性,这样该值就不会显示在日志中。之后您应该能够推送您的标签。

关于git - 蓝调 : How I can configure a delivery pipeline stage build to tag git?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33846388/

相关文章:

java - Liberty/Bluemix 上的 Spring Boot 应用程序启动 Apache,将服务器 header 附加到所有响应

bash - 如何在管道中使用 GNU Time

ffmpeg - GStreamer 强制 decodebin2 输出类型

MongoDB 在管道的 $project 阶段使用新的 ObjectId 生成相同的 ObjectId

Python Flask 作为 Cloud Foundry 应用程序与容器

git - `git config interactive.diffFilter diff-highlight` : the same diff by lines - and without color

git - 我可以在git中分离一个项目吗?

git - 如何将新的 pull 请求附加到 github 上的现有问题?

git - $(NugetPackageRoot) 宏在 VS2019 中自动更改为 *.sfproj 文件中的 "..\packages\....",在推送到 Git 之前不断要求撤消更改

python - 如何增加bluemix上spark-submit作业的日志输出?