1

I'm newbie in Jenkins. I've created pipeine with parameters in Jenkinsfile in git. It works fine.

Problem is: when I push new parameters into Jenkinsfile, then press button "Build with Parameters", there are no new parameters. I will see them only on next build, after step "Declarative: Checkout SCM" will be done.

I know workaround: add parameter to skip all steps. Then I can run build and skip all steps (except "Declarative: Checkout SCM" of course) and afterwards run build with new parameters.

Question: is there are some magic URL or other possibility to update parameters from git before build?

0

As implied by the links in comments, for better or for worse, this behavior is an unavoidable consequence of how Pipeline is designed. Pipeline configuration changes in your Jenkinsfile cannot be picked up by Jenkins without executing your Pipeline. This includes things such as adding parameters.

My personal advice is to ensure that your Pipeline jobs are non-destructive, or in other words, to ensure that the worst thing that could possibly happen by running a job is nothing. This allows you to pick up configuration changes by just running your job after committing the changes to your Jenkinsfile, and then you can simply abort the job (or let it run to completion if it's a short job) with the confidence that you won't break anything. Then subsequent runs will have your configuration changes available.

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.