'PROJECT' is not a valid parameter. Did you mean null?

297 Views Asked by At

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.

Jenkins Job Builder configuration

1

There are 1 best solutions below

0
On

Well, I should have RTFM properly:

Jenkins jobgenerator plugin has it's own kind of parameter: Generator Parameter and Generator Choice. One must use those instead of usual string, Choice Parameter):

Jenkins parameters types

So, this work: Jenkins job generator for Gerrit