Ste*_*ing 26 release github jenkins
我正在寻找一种方法来将构建工件上传为Jenkins中的Github Release作为构建后操作或发布者 - 类似于Publish Over.
Jenkins的Github插件(JENKINS-18598)尚未支持此功能.
我一直在研究postbuild-task插件,但这似乎不支持环境变量(我认为这有助于防止在构建输出中记录我的API令牌).
有没有人这样做过呢?用Jenkins解决这个问题的好方法是什么?通过cURL或CLI客户端上传(例如基于Go的github-release).
Asa*_*eki 27
我通过使用github-release工具解决了它.像魅力一样非常容易.
echo "Compressing artifacts into one file"
zip -r artifacts.zip artifacts_folder
echo "Exporting token and enterprise api to enable github-release tool"
export GITHUB_TOKEN=$$$$$$$$$$$$
export GITHUB_API=https://git.{your domain}.com/api/v3 # needed only for enterprise
echo "Deleting release from github before creating new one"
github-release delete --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${VERSION_NAME}
echo "Creating a new release in github"
github-release release --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${VERSION_NAME} --name "${VERSION_NAME}"
echo "Uploading the artifacts into github"
github-release upload --user ${GITHUB_ORGANIZATION} --repo ${GITHUB_REPO} --tag ${VERSION_NAME} --name "${PROJECT_NAME}-${VERSION_NAME}.zip" --file artifacts.zip
Run Code Online (Sandbox Code Playgroud)
And*_*rew 14
我认为你正在走上正轨!
| 归档时间: |
|
| 查看次数: |
12583 次 |
| 最近记录: |