2

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.

Mariusz
  • 1,352
  • 1
  • 16
  • 31

1 Answers1

1

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

Mikhail Tokarev
  • 2,843
  • 1
  • 14
  • 35
  • Sad to head that, this mean there is no, pending, or cancel status update. Any plan to add this in future? other CI (bitrise) got this out of the box ;) – Mariusz May 10 '22 at 20:24