Parameter/ Environment Variable - List of values support

45 views
Skip to first unread message

Sarmistha Bhuyan

unread,
Jun 17, 2022, 8:57:52 AM6/17/22
to go-cd
I have a need to show user list of values from database and user can select any value as parameter value and trigger the pipeline. Is there a way to achieve this?

Chad Wilson

unread,
Jun 19, 2022, 10:27:32 AM6/19/22
to go...@googlegroups.com
I don't think there is a clean way to achieve this to my knowledge.

The closest you could achieve that I can think of is some custom automation that
  • periodically queries your database to get the allowed values you are referring to
  • updates a pipeline's definition (via a configuration repository, or via the GoCD API) to
    • pre-populate an environment variable with a dummy value to give the user a hint as to the valid values, e.g VAL-A|VAL-B|VALC
    • at the same time automatically updates the pipeline's definition to add a first "script" task that validates the environment variable is set to one of the allowed options
If you need to use GoCD parameters and templates rather than environment variables, something similar could be done using those, perhaps.

-Chad

On Fri, Jun 17, 2022 at 8:57 PM 'Sarmistha Bhuyan' via go-cd <go...@googlegroups.com> wrote:
I have a need to show user list of values from database and user can select any value as parameter value and trigger the pipeline. Is there a way to achieve this?

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/75b6157e-f945-4592-bfd4-a9d9121fdc99n%40googlegroups.com.

Sarmistha Bhuyan

unread,
Jun 20, 2022, 2:49:05 AM6/20/22
to go-cd
Thanks Chad. 
We are trying to achieve this using  GoCD parameters and templates but not yet successful. We will try the workaround provided by you too.

Reply all
Reply to author
Forward
0 new messages