x
login Signup

Trigger an ElectricFlow build from GitLab CI

We are using GitLab. We would like to integrate GitLab with ElectricFlow.

Specifically we would like to trigger an EF build when a commit in GitLab occurs.

At the moment we are using the EF Git plugin in but this is polling every 2 min and we would like to push the build from the GitLab instead. Is this possible?

The GitLab has integration with Jenkins for example and we would like to have something similar

http://doc.gitlab.com/ee/integration/jenkins.html

avatar image By alberto.morando@lego.com 15 asked Apr 08, 2016 at 07:33 PM
more ▼
(comments are locked)
10|750 characters needed characters left

3 answers: sort voted first

It looks like GitLab has a way of running a command (such as curl) when a checkin occurs. Given that, your should be able to run and Electric Flow build procedure using the REST API (or ectool if installed on the GitLab machine).

 curl --user _user_:_password_ -X POST -d @build.json --header "Content-Type: application/json" https://SERVER:8433/rest/v1.0/jobs?request=runProcedure

Where build.json is something like: { "projectName": "CI Build Project", "procedureName": "build", "body": { "parameters": { "actualParameter": [{ "actualParameterName": "param1", "value": "value1" }, { "actualParameterName": "param2", "value": "value2" }] } } }

avatar image By gregm 2k answered Apr 12, 2016 at 04:41 PM
more ▼
(comments are locked)
10|750 characters needed characters left

Configuration on Gitlab part might be describled on the following page.

http://doc.gitlab.com/ce/ci/quick_start/README.html

avatar image By xiaogang wen 1k answered Apr 13, 2016 at 07:24 AM
more ▼
(comments are locked)
10|750 characters needed characters left

Hi

Thanks both for your answers.

I still have some questions on this solution:

1) How can we avoid to use user and password since we don´t want to expose them in clear text?

2) this method triggers EF from GitLab but is it also providing the status of the build back to GitLab for visualization on the GitLab CI?

Thanks for the help

Regards

Alberto

avatar image By alberto.morando@lego.com 15 answered Apr 13, 2016 at 09:32 PM
more ▼
(comments are locked)
10|750 characters needed characters left
Your answer
toggle preview:

Up to 8 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.