I have setup Gerrit and Jenkins. I have configured Jenkins' gerrit-trigger plugin so Gerrit changes are validated by Jenkins.
Now, want to automatically create Jenkins jobs, using Jenkins jobgenerator plugin when a new repository is created in Gerrit.
Therefore I want to create a Gerrit hook (file ./hooks/project-created
).
I have also created a Jenkins job to generate Jenkins validation job.
But when I simulate the hook manually, with JENKINS_URL=http://127.0.0.1:8081/jenkins java -jar jenkins-cli.jar -i ~/.ssh/id_rsa build puppet_creator -p PROJECT=foo BRANCH=bar
I get the error: 'PROJECT' is not a valid parameter. Did you mean null?
As mentioned above, the parameter are declared in my Jenkins Job, what's wrong? I have tried both String
and Text
parameter types.
Well, I should have RTFM properly:
Jenkins jobgenerator plugin has it's own kind of parameter:
Generator Parameter
andGenerator Choice
. One must use those instead of usualstring
,Choice Parameter
):So, this work: