How to pass parameters to Jenkins Pipeline?

43 views
Skip to first unread message

Kai

unread,
Jul 6, 2017, 1:23:55 PM7/6/17
to Jenkins Users
Hi,

We are trying to setup a Jenkins pipeline and have a Deploy step to deploy a specific version of the application.

The pipeline job will be invoked programmatically by another system.

Is there a way to pass in parameters programmatically to the pipeline job so it knows which version to deploy?

Thanks

David Karr

unread,
Jul 6, 2017, 3:03:17 PM7/6/17
to Jenkins Users
This should be a good summary of your options:
https://wiki.jenkins.io/display/JENKINS/Parameterized+Build .

>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/c2c2f562-acce-475c-8a5f-eb0544118113%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Curtis Kline

unread,
Jul 6, 2017, 6:51:20 PM7/6/17
to jenkins...@googlegroups.com
Along these same lines, I'd like to have a "Choice" parameter where the user can select a build type. I'll then use the produced environment variable ($TYPE) in the build steps. In the Post steps, I'd like to deploy the right type of build via an API token. The API token will be different depending on which of the types were selected. I'm imagining something like:

IF $TYPE==BETA
THEN TOKEN=12345

That way I could use $TOKEN in my post-build deploy step.

Can anyone point me in the right direction on this?

Thanks,
Curtis


On Thu, Jul 6, 2017 at 2:03 PM, David Karr <davidmic...@gmail.com> wrote:
On Thu, Jul 6, 2017 at 10:23 AM, Kai <kaite...@gmail.com> wrote:
> Hi,
>
> We are trying to setup a Jenkins pipeline and have a Deploy step to deploy a
> specific version of the application.
>
> The pipeline job will be invoked programmatically by another system.
>
> Is there a way to pass in parameters programmatically to the pipeline job so
> it knows which version to deploy?

This should be a good summary of your options:
https://wiki.jenkins.io/display/JENKINS/Parameterized+Build .

>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAA5t8VpAmUbM90g6ujikFMfg_C_SGLE4ZgHwzCXDaUySMmXeng%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages