1

My build parameters are defined in my jenkinsfiles

All builds run on container slaves on google kubernetes engine cluster

This means users need to wait for a container to start before anything happens, including just updating the "Build with parameters" choices.

Can I set parameters outside of the pipeline directive so it doesnt need to start a container to update the parameters?

or even better maybe there is a way to have Jenkins run functions in my jenkinsfile to get the updated parameters when it scans branches?

1

EDIT: It might have a chance for me to misread your question at the first time, so let me add another one.

If you meant by Jenkinsfile as you have a manual parameter input in Jenkinsfile for Multibranch or Github Org pipeline, then probably bad idea.

Those kind of jobs should run with predefined parameters or take them on-the-fly like manipulating some environment variables without user input.

You can simply make another pipeline job for manual trigger if the predefined parameters can't cover all the case you need.

And for run function, it looks like build job is what you are looking for.

https://jenkins.io/doc/pipeline/steps/pipeline-build-step/#-build-%20build%20a%20job

build job: 'Another job in same Jenkins server', parameters: [string(name: 'param1', value: ${new_value})]

--------------------------------------

Are you sure the parameter input is waiting for slave containers? or do you use some special choice plugins for build parameter?

I think a job is even not starting until a user fills out the parameters and hit the build button in Jenkins UI - so no container required until then. We had same k8s slaves, but never had that issue.

(But some parameter plugins might need some pre process..)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.