Could you please provide a minimum example of importing a function of a Groovy configuration script from a file located in the same directory as the importing Groovy script? Or maybe even put an example into https://github.com/gocd-contrib/gocd-groovy-dsl-config-plugin/tree/master/example/src/main/groovy for future reference.
Thanks a lot. воскресенье, 24 апреля 2022 г. в 13:20:37 UTC+7, [email protected]: > The groovy pipeline plugin also allows you to import code so you can just > merge some global variables as you need. If you are worried about having to > write new config files in groovy - you can simply export and convert > json/yaml to groovy. > > On Sun, 24 Apr, 2022, 11:42 Chad Wilson, <[email protected]> wrote: > >> Have you tried having a file in the config repository which declares only >> top-level environments (with env vars), and then separate files inside the >> same confi repo which refer to those environments by name inside pipelines? >> >> if I recall correctly, the `n` YAML files discovered by the config repo >> pattern you configure are merged together and validated as a whole so you >> *should* be able to factor them out, I believe? >> >> -Chad >> >> On Sun, Apr 24, 2022 at 2:04 PM Sifu Tian <[email protected]> wrote: >> >>> Hi Ashwanth, >>> >>> Thats for your response. If I understand the examples in the README, >>> you would have to add "environments" and the "variables" to every yaml file >>> that is hosted in github. >>> There is no central "Environment group that can be used by the config >>> repository that you can add all the pipelines to. >>> I have many pipelines that share the same secure variables that I was >>> able to add them to that environments group when I built out the pipelines >>> manually. >>> Once I converted them to config repository, it appears I would have to >>> define each pipeline individually with those settings. >>> >>> >>> >>> >>> >>> On Friday, April 22, 2022 at 2:15:19 AM UTC-4 [email protected] >>> wrote: >>> >>>> In this example on the README >>>> <https://github.com/tomzo/gocd-yaml-config-plugin#example>: I see >>>> environments and pipelines defined. Does that not help? >>>> >>>> On Fri, 22 Apr 2022 at 01:08, Sifu Tian <[email protected]> wrote: >>>> >>>>> Hi, >>>>> >>>>> I recently converted all of our pipelines to leverage config >>>>> repository. >>>>> One thing I haven't determined is how to get env variables that I can >>>>> use by all pipelines. >>>>> I lose the ability to add the pipelines to any environment that can >>>>> consume the same env variables. >>>>> One approach was to place the variables in my Dockerfile however we >>>>> have some secure variables that we use that we cant leverage in a >>>>> dockerfile and placed in SCM (Github) >>>>> >>>>> Can someone tell me how this has been addressed/solved. >>>>> >>>>> -- >>>>> 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 [email protected]. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/go-cd/edce1657-6112-4293-8b32-9c24a20dc267n%40googlegroups.com >>>>> >>>>> <https://groups.google.com/d/msgid/go-cd/edce1657-6112-4293-8b32-9c24a20dc267n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> >>>> >>>> -- >>>> >>>> Ashwanth Kumar / ashwanthkumar.in >>>> >>>> -- >>> 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 [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/go-cd/d168cdea-6655-4603-b9ef-da52284a9f98n%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/go-cd/d168cdea-6655-4603-b9ef-da52284a9f98n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> 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 [email protected]. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/go-cd/CAA1RwH_1H3Hh_6F7TY8fpzThhXt33MJTbUDraqq3jCZwTzzZQQ%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/go-cd/CAA1RwH_1H3Hh_6F7TY8fpzThhXt33MJTbUDraqq3jCZwTzzZQQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/f1ef10f8-b840-4779-8c17-bf4dcca9a390n%40googlegroups.com.
