Yaml Config repo- Pluggable scm

30 views
Skip to first unread message

Obiageli Adegbite

unread,
Nov 13, 2024, 2:09:35 PM11/13/24
to go-cd
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

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



    materials:
      Portfolio:
        scm: Database
        destination: source      

format_version: 10
pipelines: {}
environments: {}
common:
  scms:
    Database:
      plugin_configuration:
        id: "git-path"
        version: 1
      options:
        username: myusername
        password: '{{SECRET:[value][myPAT]}}'        
        branch: main
        shallow_clone: true
        auto_update: true

Chad Wilson

unread,
Nov 13, 2024, 9:49:52 PM11/13/24
to go...@googlegroups.com
Hiya

The scm: 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

--
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 visit https://groups.google.com/d/msgid/go-cd/4571382a-b533-4de9-bbd4-72c9e6b82ee3n%40googlegroups.com.

Christopher Dean

unread,
Nov 27, 2024, 7:56:58 PM11/27/24
to go-cd
WELDING MACHINES AND ACCESSORIES FOR SALE ONLINE WITH SAFE AND GUARANTEED SHIPPING.


SHOP BELOW

Buy discounted welders, plasma cutters and welding safety gear by premium brands like Miller, Lincoln Electric, Hypertherm, Hobart and Black Stallion - from the mouse with over 86 years of welding experience.

where to order welding machines and accessories online with safe shipping.

we have the best welding tools like reels,miller remote,pipe bender,welding cable, lincoln rods,leads,miller welding helmet,mig guns,tig torches,plasma torches,welding cables,mig welders,tig welders,Etc.

Order now from our website below with safe and guaranteed shipping


Reply all
Reply to author
Forward
0 new messages