gojenkinscdgo-cd

Parametrized pipeline in GoCD?


I'm evaluating GoCD if we would be able to use it instead of Jenkins.

Is there any way how to create a parameterized pipeline like parametrized jobs in Jenkins?

In Jenkins, we're using these parameters in some jobs which are executed manually to configure "full-rebuild" of the project:

enter image description here

This bool value is passed as ENV variable to the job. I have found that GoCD has ENVs but I didn't find if there is a way how such ENV can be selected before manual executing.

Thanks


Solution

  • Yes. It is possible to parameterize pipelines in GoCD.

    Go to pipeline settings -> parameters and add desired parameters. A parameter can be added with a default value, if required.

    The next time a pipeline is triggered, one could override the default value with new value and trigger it. The parameters can be accesses inside pipeline scripts using #{myParam}.

    More detail here: https://docs.gocd.org/current/configuration/admin_use_parameters_in_configuration.html

    Below is a snapshot to set Docker information as environment variables. enter image description here