Re: [go-cd] 1. Failed to parse pipeline testA; expected a hash of pipeline materials

39 views
Skip to first unread message

Chad Wilson

unread,
Oct 9, 2024, 11:39:56 PM10/9/24
to go...@googlegroups.com
Hiya Obiageli

It's a YAML format problem. When it talks about a "expecting a hash" in the error message, it's another word for expecting a dictionary/map of values (key/value - rather than a list). So in materials it expects something like the below with a name for the material rather than a list of materials, like documented at https://github.com/tomzo/gocd-yaml-config-plugin?tab=readme-ov-file#pluggable

materials:
third-party-material:
scm: ThirdParty
destination: source/ThirdParty
stages:
- #blah

Separately, I am wondering if there's a reason you're trying to use "manually defined" Pluggable SCMs with your YAML config? It is possible to dynamically define pluggable SCMs which are a lot easier to manage in one place, e.g like in the example at https://github.com/TWChennai/gocd-git-path-material-plugin?tab=readme-ov-file#via-pipelines-as-code or in the b

This would look something like the below when using the git-path SCM plugin. If you have multiple pipelines with the same material you could extract it to a common YAML fragment for re-use of the values.

materials:
third-party-material-dynamic:
plugin_configuration:
id: git-path
options:
url: https://github.com/path-to/shared-repo.git
path: ./third-party-code
username: username
secure_options:
password: 'encrypted_value'
destination: source/ThirdParty
-Chad

On Wed, Oct 9, 2024 at 9:53 PM Obiageli Adegbite <oec...@gmail.com> wrote:
Hello,

I am using yaml config file for pipeline as a code for gocd and i am also using the pluggable scm for the first time.

i get this error:
. Failed to parse pipeline Test; expected a hash of pipeline material.
can you help

yaml.png
scm.png

--
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/d061a702-72ac-44c6-9504-c1cc7ddc044bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages