Pregunta

Can someone steer me in the right direction please?

I have a simple multijob in Jenkins. Its in 3 phases:

  1. Stops the application
  2. Deploys based on what tag I tell it to build from (using the List Subversion Tags option under "This build is parameterized")
  3. Starts the app back up.

Doing these steps individually works fine. I can select my tag, I want to build, from the drop down and away I go. What I want to do is select the tag at the beginning of the MultiJob so that it gets passed to the correct phase and will run end to end....stop - deploy - start.

I tried setting the MJ up the same way that I did the deploy step but it is not getting the parameter passed to it. In the output it just says "failed to retrieve build parameters".

Does anyone know how to input the tag parameter at the beginning of the MJ so that it is carried over and passed to the second phase the way I described?

Thanks.

¿Fue útil?

Solución

Multijob? Are you talking about:

  • Multi-configuration project with multiple Axises
  • Regular free-style project with multiple Build steps

In either case, both the free-style and the multi-configuration projects have access to build Parameters through use of environment variables, either $PARAM (Unix) or %PARAM% (Windows) where "PARAM" is the name of your parameter.

Re-reading your question makes me think you are talking about a job triggering Downstream jobs. In that case, you would need to use Parameterized Trigger Plugin to trigger your downstream jobs. Then, under "Add Parameters" dropdown select "Current build parameters" to pass the same parameters from one job to another. Once again, you reference them as you would any other parameter through an environment variable.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top