This is my attempt at working around the fact that I can't get any plugins to create new Jenkins jobs when a new unknown Gitlab project is created.
I'm creating a new Jenkins job. It uses the parameterized build option using a string parameter of payload.
I have Trigger builds remotely enabled with a token selected.
The build is set to execute shell:
#!/bin/bash
echo "The payload is $payload"
In gitlab, I have a the following system hook:
When I create new gitlab projects, the system hook is firing and the Jenkins job is kicking off however the echo of the $payload does not function. Can I only pass parameters via the url and not via json payload? Am I using an incorrect variable?
To verify the post data I've setup a second system hook that hits
http://requestb.in/ and got the following results:
FORM/POST PARAMETERS
NoneHEADERS
X-Request-Id: 4f9a2ef0-bcb3-4813-9311-ae387c77d38b
Connect-Time: 0
Host: requestb.in
Total-Route-Time: 0
X-Gitlab-Event: System Hook
Connection: close
Content-Type: application/json
Via: 1.1 vegur
Content-Length: 304
RAW BODY
{"event_name":"project_destroy","created_at":"2016-03-10T20:12:09Z","name":"test-new-project1","path":"test-new-project1","path_with_namespace":"me/test-new-project1","project_id":26,"owner_name":"Dane","owner_email":"te...@test.com","project_visibility":"private"}