更新CODEMAGIC ANDROID构建状态为自托管GitLab存储库

发布于 2025-01-24 09:47:44 字数 109 浏览 3 评论 0原文

我有自托管GitLab存储库,并且使用Codemagic CI。

我已经在Gitlab设置中配置了使用Webhooks的自动触发,但是在构建完成后,状态未显示在GitLab的MR TAB中。

I have self-hosted GitLab repository and I use Codemagic CI.

I have already configured automatic triggering with webhooks in GitLab settings, but after the build is complete, the status is not displayed in the MR tab in GitLab.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雪化雨蝶 2025-01-31 09:47:44

不幸的是,CODEMAGIC不会向自托管存储库报告构建状态。但是,您可以在Publishing/Codess部分中添加简单curl命令,以报表传递或失败状态。

scripts:
  - # you build commands
    ...
  - name: Build finished successfully
    script: touch ~/.SUCCESS
publishing:
  scripts:
    - name: Report build status
      script: |
        if [ -a "~/.SUCCESS" ] ; then
           # build successful
        else
           # build failed
        fi  

另请参见Gitlab API Doc如何添加状态检查 https://docs.gitlab.com/ee/api/status_checks.html#set-set-setus-status-status-of-an-extern-sternal-status-check

ps:如果您使用工作流程编辑器,则可以添加post post Post - 发布脚本和使用内置环境变量cm_build_step_status

Unfortunately Codemagic doesn't report build status back to self-hosted repositories. However you can add simple curl command in publishing/scripts section to report passed or failed statuses.

scripts:
  - # you build commands
    ...
  - name: Build finished successfully
    script: touch ~/.SUCCESS
publishing:
  scripts:
    - name: Report build status
      script: |
        if [ -a "~/.SUCCESS" ] ; then
           # build successful
        else
           # build failed
        fi  

see also GitLab API doc how to add status check https://docs.gitlab.com/ee/api/status_checks.html#set-status-of-an-external-status-check

ps: if you use Workflow Editor you can add post-publishing script and use built-in environment variable CM_BUILD_STEP_STATUS

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文