Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Jenkins build parameters are set #278

Merged
merged 1 commit into from
Dec 21, 2016
Merged

Conversation

suzannehamilton
Copy link
Contributor

Jenkins build parameters do not seem to be set on the very first build of a new branch. env.PARAM_NAME returns null, and referring to them directly by PARAM_NAME throws groovy.lang.MissingPropertyException. This means that the first build of a new Jenkins branch always fails.

The parameters are set correctly on every subsequent build, whether it is triggered automatically by a branch push or manually in by a Jenkins user.

This is an extremely hacky solution - it checks for null parameters and makes sure that they are set to the defaults if so - but I haven't found anything better.

If anyone has any other ideas or can spot what I'm doing wrong with the parameters, please let me know! (@afda16?)

If not, I'll report this to Jenkins in case it's a broader issue with parameterized builds in multibranch pipelines.

Jenkins build parameters do not seem to be set on the very first build
of a new branch. env.PARAM_NAME returns null, and referring to them
directly by PARAM_NAME throws groovy.lang.MissingPropertyException.

This is a very hacky solution - it checks for null parameters and makes
sure that they are set to the defaults if so - but I haven't been able
to find a better solution.
@suzannehamilton
Copy link
Contributor Author

I've raised this as a Jenkins pipeline issue since other people have seen the same error:

https://issues.jenkins-ci.org/browse/JENKINS-40574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants