I would like to start builds in GitLab CI
in response to issue transitions
in JIRA
.
I have not found a direct way to do that from searching online. I have found ways to get GitLab to tell JIRA what to do, but seemingly no solutions in the other direction.
We have a constraint which would make JIRA
to GitLab
messages very helpful: we must deploy to servers under the rule that a branch gets deployed
- to ...test.example.com when the JIRA issue has status
QA
- to ...stage.example.com when the JIRA issue has status
Stage
- to ...beta.example.com when the JIRA issue has status
Beta
- to ....example.com when the JIRA issue has status
Done
Note that we have added a Merge Request
field to issues in our JIRA
, so we know "the branch for an issue" (and "the issues for a branch").
To satisfy this constraint we run a python script to do deploys for QA
, Stage
, Beta
every hour in a crontab for every project. That script has too many top-level loops, and too many features (being old).
Instead I would prefer to have JIRA
notify that an issue is ready for re-build, and then ask our GitLab CI
to re-build the relevant Merge Request
.
In a JIRA workflow status transitions can "Trigger A Webhook", but it seems we will have to supply our own REST api
to which JIRA
can post
messages, and which can then ping GitLab
. That's a new internal app, which will need maintenance, and gain features, so we would like to find out if there are any other solutions.