GoCD YAML configuration in source control

3,121 views
Skip to first unread message

Tomasz Sętkowski

unread,
Jul 16, 2016, 12:33:14 PM7/16/16
to go-cd
Hi all,

For those of you following progress on configuration repositories - I have just finished working on first release of YAML plugin. It can be downloaded from releases page at https://github.com/tomzo/gocd-yaml-config-plugin

If you don't know what is a configuration repository, see this introducing document.

Cheers,
Tom

Ken Mugrage

unread,
Jul 20, 2016, 4:51:16 PM7/20/16
to go...@googlegroups.com

Hello,

Is there a specific naming convention the yaml files need to be in order to be picked up? (The sample repo isn't publicly available).

Thanks!
Ken

--
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.
For more options, visit https://groups.google.com/d/optout.



--
Ken Mugrage - ThoughtWorkskmug...@thoughtworks.com+1(425) 835-3056@kmugrage

Tomasz Sętkowski

unread,
Jul 20, 2016, 6:15:24 PM7/20/16
to go-cd
Hi Ken,

Thanks for trying out the plugin. The default pattern is any file that ends with .gocd.yaml ; Sorry about the missing example, I just pushed a verified, working repository to https://github.com/tomzo/gocd-yaml-config-example

Regards,
Tom

David Rice

unread,
Jul 21, 2016, 6:34:28 AM7/21/16
to go...@googlegroups.com
Tom - 

Amazing work on the config in repository feature! I'm so happy to finally see it in GoCD.

If anyone wants to quickly play around with config in repositories, I've got a very simple fan-in demo:

  <config-repos>
    <config-repo plugin="json.config.plugin">
      <git url="https://github.com/djrice/gocd_sandbox_adder" />
    </config-repo>
    <config-repo plugin="json.config.plugin">
      <git url="https://github.com/djrice/gocd_sandbox_multiplier" />
    </config-repo>
    <config-repo plugin="json.config.plugin">
      <git url="https://github.com/djrice/gocd_sandbox_calculator" />
    </config-repo>
  </config-repos>

And if you don't want to deal with installing the latest version of Go to try it out and don't mind a docker setup, you can take a look at https://github.com/djrice/gocd_sanbox to quickly get going with this example (as well as golang agents).

-David

Ken Mugrage

unread,
Jul 21, 2016, 9:47:05 AM7/21/16
to go-cd

Thanks Tom, and thanks for all the great work!

René Perschon

unread,
Oct 5, 2016, 11:37:46 AM10/5/16
to go-cd
Hi Tom!

I'm trying to get your plugin to work in a dockerized gocd-server, however my git repo is not imported and i can't see any logs hinting at a problem. Can you give me a hint on how to find the problem? I'm using the gocd/gocd-server image from here https://hub.docker.com/r/gocd/gocd-server/ .

Tomasz Sętkowski

unread,
Oct 5, 2016, 11:57:44 AM10/5/16
to go...@googlegroups.com
Hi René,

Docker or no-docker it should not matter. You most likely have bad configuration. Can you post <config-repos> section of your GoCD XML? Also note that your git config repository must have files ending with .gocd.yaml. Can you post one of those files too?

Regards,
Tom
--
You received this message because you are subscribed to a topic in the Google Groups "go-cd" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/go-cd/bAFYdWOQLEs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to go-cd+un...@googlegroups.com.

René Perschon

unread,
Oct 5, 2016, 12:29:14 PM10/5/16
to go-cd
Sure!

Here's my server config:
<?xml version="1.0" encoding="utf-8"?>
<cruise xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="cruise-config.xsd" schemaVersion="84">
  <server artifactsdir="artifacts" agentAutoRegisterKey="123456789abcdef" commandRepositoryLocation="default" serverId="03ca58da-7be3-459d-b208-057a0e2c344c" />
  <config-repos>
    <config-repo plugin="yaml.config.plugin">
    </config-repo>
  </config-repos>
</cruise>

And here's my pipeline file (result-flow.gocd.yml):
---
pipelines:
  "result-flow":
    group: testgroup
    materials:
      mygit:
    stages:
      - build:
          jobs:
            build:
              tasks:
                - exec:
                    command: mvn clean compile
            test:
              tasks:
                - exec:
                    command: mvn test

I also have a simple.gocd.yaml pipeline file in the repository, it's one of the examples from your github.

Tomasz Sętkowski

unread,
Oct 5, 2016, 12:48:41 PM10/5/16
to go...@googlegroups.com
Your configurations look correct. Having simple.gocd.yaml is a good idea too, because it is a part of tests. I can't tell why you cannot see pipelines on dashboard. Can you check these:
1. Is yaml configuration plugin visible in Admin->Plugins tab?
2. Are server health messages empty?
3. If it is, then try restarting server and grep logs for "leopard2a5-knorke/local-gocd" - it should cover any MDU errors or configuration repository, which are usually the only problem.

Also, you are using gitlab and https. Make sure that GoCD server can clone that project. You can try making it public on gitlab temporarily.
If Go cannot clone it, it will be in the logs.

Let me know if that helps, otherwise new server+plugin might be broken, I haven't updated in a while.

René Perschon

unread,
Oct 6, 2016, 3:08:54 AM10/6/16
to go-cd
Hi Tom!

1. yes the plugin is there
2. I've seen a health message pop up today, and it vanished before i was able to read the whole text (boooo!)
3. no log messages of any help

but just reading part of the health message was enough, the server wasn't able to clone the repository due to restrictions on the repo itself. So thanks for your help!

Tomasz Sętkowski

unread,
Oct 10, 2016, 4:05:12 PM10/10/16
to go-cd
Hi,

Please use the dedicated gitter channel for discussing issues and usage of YAML or JSON configuration repositories. 

Cheers,
Tom

Michael Roepke

unread,
Mar 12, 2017, 6:27:55 PM3/12/17
to go-cd
Ho Tomzo,

do you still maintain and improve your go-cookbook github project?

Thanks for a response+

Cheers
Michael

Tomasz Sętkowski

unread,
Mar 13, 2017, 5:29:04 AM3/13/17
to go...@googlegroups.com
Hi,

I do. I also use it personally with a wrapper cookbook so I keep gocd cookbook operational.
Currently Varsha V. is working on few improvements.

Cheers,
Tom
--

nick....@tvnz.co.nz

unread,
Sep 12, 2017, 1:13:15 AM9/12/17
to go-cd
Hi Tom,

Do the files need to be in the repository root or can they be stored in a sub-directory?

Thanks,
Nick

Aravind SV

unread,
Sep 12, 2017, 12:59:44 PM9/12/17
to go...@googlegroups.com
You should be able to change the file pattern in the plugin settings. I think it defaults to *.gocd.yaml. Maybe this works? "subdirectory/*.gocd.yaml". Haven't tried it.

The best place to ask questions about those plugins is probably here: https://gitter.im/gocd/configrepo-plugins/

Cheers,
Aravind

venkatanathen kannan

unread,
Oct 11, 2018, 2:01:49 PM10/11/18
to go-cd
HI, 

I'm kind of stuck. 

I've added the below script
    <config-repo pluginId="yaml.config.plugin" id="aws-module-vpc">
      <git url="http://git.venkatkannan.com/aws-module-vpc.git" />
    </config-repo>
By adding above, will that create a pipeline automatically ?

how to refer the appropriate branch?

Thanks,
VK

Aravind SV

unread,
Oct 11, 2018, 4:52:33 PM10/11/18
to go...@googlegroups.com
Hello!

https://gitter.im/gocd/configrepo-plugins might be a good place to ask questions about the YAML and JSON config plugins.

Cheers,
Aravind
Reply all
Reply to author
Forward
0 new messages