I am using a pipeline in a jenkinsfile and I am not sure how to properly link the job in Jenkins and the pipeline.
I defined parameters in my jenkinsfile (some with def
Ah, yes, it got me the first time around also.
The first time that you run the pipeline, the jenkinsFile DSL job definition pretty much overrides the whole job definition that you have entered thru the GUI. That affects the parameters in particular.
So make sure you define the parameters exactly how you want them in the Jenkinsfile, then run the job once, and the GUI will have the same config for the parameters, so that when you run again, it will ask for the parameters and use the default values, that you specified in the DSL. There is nothing more to it.
Yes, having to run twice everytime you modify the parameters in the DSL is annoying. But it sort of makes sense if you consider that the job has to execute for the DSL to be evaluated, but first it needs to ask for parameters if you have some defined via the UI, BEFORE it checks out and evaluates the DSL...