Hiya

The s*cm: *key inside a pipeline material is *only needed/used* when trying
to* reuse a pluggable SCM that was manually configured on the server*. So
the ID here would have to be some server the Pluggable SCMs page, a UUID
like "7636d518-f136-4e92-b6bd-f66862650c5c".

But you don't *need* to have server pre-defined pluggable SCMs and can use
material syntax (like you have) to dynamically create them.

The "common" section is just a "convention" to put chunks of YAML to refer
to with YAML aliases. There is so special GoCD understanding of the YAML
aliases, it's just a feature of YAML. So to have your SCM in a "common"
area, and refer to it later, you'd need to give chunks aliases. Something
like the below should work, assuming you want to have different
destinations for each material where you re-use the "common" SCM definition.

format_version: 10
environments: {}
common:
  scms:
    Database: &scm-database # define an alias for all the keys in this
block so the pluggable SCM can be reused
      plugin_configuration:
        id: "git-path"
        version: 1
      options:
        url: https://my/repo/_git/Database
        username: myusername
        password: '{{SECRET:[value][myPAT]}}'
        branch: main
        shallow_clone: true
        auto_update: true
pipelines:
  some-pipeline:
    materials:
      Portfolio:
        <<: *scm-database # merge keys from common definition above
        destination: source # add in key for the destination folder if
you want to customise the clone dir/folder


Try something like that? You may want to use a YAML tool to double check
the aliases are working as you expect in the "rendered" YAML before
submitting for GoCD to use.

-Chad

On Thu, Nov 14, 2024 at 3:09 AM Obiageli Adegbite <oech...@gmail.com> wrote:

> Hello,
>
> I seem to not be able to define a new pluggable materials that is not
> defined in the GoCD serve.
> I am using a Yaml config repo, I have created a file called scm.gocd.yaml
> where i would define new scm pluggable materials
> according to
> https://github.com/tomzo/gocd-yaml-config-plugin?tab=readme-ov-file#pluggable
>
> This is what my scm.gocd.yaml looks so i referenced the material in
> another file lets call it dev.gocd.yaml , this is the error message i get
>
>
>    - Parsing configuration repository using Plugin yaml.config.plugin
>    failed for material: URL:
>    https://dev.azure.com/Taqauto/Taq-IT-Ops-GoCD/_git/GoCD-Pipelines,
>    Branch: develop13 Nov, 2024 at 14:08:51 Local Time
>
>    Failed to find referenced scm 'Database'
>
>
>
>     materials:
>       Portfolio:
>         scm: Database
>         destination: source
>
> format_version: 10
> pipelines: {}
> environments: {}
> common:
>   scms:
>     Database:
>       plugin_configuration:
>         id: "git-path"
>         version: 1
>       options:
>         url: https://my/repo/_git/Database
>         username: myusername
>         password: '{{SECRET:[value][myPAT]}}'
>         branch: main
>         shallow_clone: true
>         auto_update: true
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/go-cd/4571382a-b533-4de9-bbd4-72c9e6b82ee3n%40googlegroups.com
> <https://groups.google.com/d/msgid/go-cd/4571382a-b533-4de9-bbd4-72c9e6b82ee3n%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 go-cd+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/go-cd/CAA1RwH8pUheDjH39gO0xvd1KmbLFnbeiv7oAogDGm%2Bd_fsw7Wg%40mail.gmail.com.

Reply via email to