Sequential build on Gitlab CI -> Bitrise

Hi guys

I am having some issues with creating a sequential pipeline via Gitlab CI + Bitrise.io
I don’t want to use the webhooks provided by Bitrise since that causes builds to be started in parallel, while I want to run my Bitrise build only after the Gitlab CI build passes.

I am almost able to achieve this by using the Bitrise Gitlab step (v0.92) but I have a problem when I set my PR to be merged right after the pipeline succeeds, as it gets merged right after the Gitlab build passes. (see screenshot)

I believe this is related to the fact that I start the Bitrise build from gitlab CI via the cURL command and it reports success right after the cURL returns.

Is there a way to achieve a sequential pipeline and make Gitlab wait for bitrise to pass?

Thanks a bunch!

1 Like

Hi @Deniss,

Interesting question!

Not 100% sure about the gitlab config, but a good first step would be to ensure that the build status is reported by bitrise on gitlab.

Do you use a self hosted gitlab server or gitlab.com?

HI @viktorbenei

I am using gitlab.com, however the CI runner is self-hosted (which shouldn’t matter).

The Gitlab step in the bitrise pipeline is reporting back (based on logs).

So my branch was merged automatically but Bitrise build was still running :slight_smile:

Bitrise:

I’m not that familiar with GitLab’s auto merge feature with multi CI, can it be that you might have to mark the bitrise status as “required” somewhere in the settings on gitlab? Maybe only your gitlab ci status is marked as required before the merge? :thinking:

Or can it be that gitlab doesn’t support multiple CI status for the auto merge feature? The docs (https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) only mention “a pipeline”, singular.

That is true, however I was thinking it is possible to achieve the desired result while treating the Bitrise build as a step in Gitlab CI.
The only idea left on my mind is to add a sleep after the curl that starts the Bitrise build so Gtilab would see the step as registered (after which it will have to wait for it to pass), but still I need to try that - not sure if it will work.

I’d suggest you to check whether GitLab has an option to require multiple CI status checks, similar to e.g. the GitHub protected branch one:

Of course waiting in the gitlab part might also work, that’s definitely possible via our API but seems quite wasteful to keep the gitlab ci “build” running to wait for the bitrise.io one.