Why pipelines defined in configuration repository can not be cloned?

23 views
Skip to first unread message

Stygian Smash

unread,
Apr 24, 2023, 6:01:02 AM4/24/23
to go-cd
    I originally wanted to clone multiple pipelines and modify their meterial to different git branch. But then I find out that I can't clone or extract template from pipelines that are defined in configuration repository. I wonder if there is any other way to accomplish this when using the "pipeline as code" feature. All I can think of is to encapsulate the GoCD api.
    By the way, template may not suit me because I can not fetch artifacts from another template

    Thanks in advance.

Jason Smyth

unread,
Apr 24, 2023, 11:13:23 AM4/24/23
to go-cd
Hi there,

Maybe I am missing something, but is there some reason you can't copy the file that defines the pipeline(s) in your configuration repository?

Hope this helps,
Jason

Chad Wilson

unread,
Apr 24, 2023, 11:14:47 AM4/24/23
to go...@googlegroups.com
I'm not one of the original authors, however I suspect that is because if you are using pipelines-as-code they generally expect folks to clone/copy the original pipeline yaml/json/groovy rather than use an alternate representation via the UI, so it possibly wasn't a priority.

The Admin > Pipelines tab does allow you to download/export to a different pipeline-as-code format, or as you say, you can use the APIs to get the API JSON representation.

For what it's worth you can fetch artifacts from the result of one templated pipeline into another templated pipeline, but generally you need to parameterise the upstream pipeline's fetch path from the downstream pipeline template. In other words, when you create an instance of downstream-pipeline from the template and you want to fetch from upstream-pipeline3 you would set the parameter of "upstream-pipeline-name" to "upstream-pipeline3". The fetch task inside the downstream-pipeline template would have the pipeline value set to #{upstream-pipeline-name} and otherwise hard-code the stage/job fetails to match the upstream template.

-Chad

--
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/550e59f7-6692-47a1-aa0e-273be3eeb37dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages