Programmatic create pipeline

611 views
Skip to first unread message

Robson Roberto Souza Peixoto

unread,
May 27, 2014, 7:36:15 PM5/27/14
to go...@googlegroups.com
Hi guys,

Are there anything on go-cd that permits create pipelines programmatically like it [1]?


Thanks

--
Robson Roberto Souza Peixoto
Robinho http://robsonpeixoto.com/
Master in Computer Science, University of Campinas
Linux Counter #395633
IRC: robsonpeixoto
Twitter: http://twitter.com/robinhopeixoto
github: https://github.com/robsonpeixoto

jonny sywulak

unread,
May 28, 2014, 12:23:06 PM5/28/14
to Robson Roberto Souza Peixoto, go...@googlegroups.com
I'd actually be very interested in seeing something like this as well. I'm currently investigating if we can replace Jenkins with Go, and figuring out how to lay down all the job configuration is the part I'm dreading the most.


--
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.

Gavin Morgan

unread,
May 28, 2014, 8:52:29 PM5/28/14
to go...@googlegroups.com, Robson Roberto Souza Peixoto
The cruise-config.xml is accessible enough. Any tool/DSL for manipulating XML would serve you, here.

A decent practice is to outline your pipeline designs beforehand, determining

a) which jobs ought to block which artifacts,
b) which independent services must be running before which jobs can integrate with them,
c) which combinations are most efficiently run in parallel.

We've done this often in Markdown, but never used it to generate XML, only to guide the plumbers.

Aravind SV

unread,
May 30, 2014, 12:03:12 AM5/30/14
to Gavin Morgan, go...@googlegroups.com, Robson Roberto Souza Peixoto
Yes, there are a few customers who modify the XML programmatically. It works. However, as you can see from the Roadmap mail, first-class "Pipeline creation API" is right up there.

There is an existing API for creating pipelines here, but in my opinion (and in the opinion of most others I've talked to), it's not good enough. So, the new one should be more generic and flexible. Any thoughts about this are obviously welcome!

Cheers,
Aravind

Lee Benhart

unread,
Jun 6, 2014, 9:47:22 AM6/6/14
to go...@googlegroups.com, robson...@gmail.com
I was able to perform such a task a few years ago.  I used a simple xml template that outlined what a pipeline should look like, created a nant build script to complete the template, validate it for correctness, add it to the go config xml file, and then replace the config on the server with the new file.  All the pipelines were stored in the version control system as well. The collection of the variables used to complete the new pipeline was actually driven from a GO pipeline, using trigger with options.

Lee

srinivas upadhya

unread,
Jun 8, 2014, 9:03:15 AM6/8/14
to go...@googlegroups.com, robson...@gmail.com
With Go being open-source you can "reuse" all the code that manages config-xml (read, write, validate etc).
"config-server" is the component that does the read/write bit while "config-api" has java mapping for xml.

Marius Ciotlos

unread,
Jul 26, 2014, 4:01:10 PM7/26/14
to go...@googlegroups.com, robson...@gmail.com
Hi guys, 

I wanted to use the same mechanism to modify templates (get the xml, change it and save it back to the server), however the API only allows for getting the XML. How did you get the XML config changed on the GO server? Did you actually do sftp or something?

I would really like to do this as clean as possible, so using some sort of API. 

Marius Ciotlos

unread,
Aug 3, 2014, 8:57:01 AM8/3/14
to go...@googlegroups.com, robson...@gmail.com
It seems that the documentation is unclear. We've been able to both GET and POST the config.xml using the API. The POST is just not documented. 

The way to got about it is to store "x-cruise-config-md5" from the headers when you're doing the GET on the api endpoint (we're using "/api/admin/config.xml")
When you want to post back the data, you need to send as parameters the XML content inside 'xmlFile' and the above value inside the 'md5' using the same endpoint as above.

I think someone should update the documentation. We have now a working ruby script to clone Templates :-)

Marius

Rinat Shagisultanov

unread,
Feb 18, 2015, 1:55:37 PM2/18/15
to go...@googlegroups.com, robson...@gmail.com
Does md5 value and xmlFile+ payload need to go as "parameters" for the http request? Or we need to do something with the headers?

Zabil C M

unread,
Feb 19, 2015, 1:05:58 AM2/19/15
to Rinat Shagisultanov, go...@googlegroups.com, robson...@gmail.com
 Yes, md5 and xmlFile go as parameters to the POST. There's nothing to be set on the headers.

--

Ranjib Dey

unread,
Feb 19, 2015, 1:14:08 AM2/19/15
to Zabil C M, Rinat Shagisultanov, go...@googlegroups.com, robson...@gmail.com
currently im doing something similar using chef, but that involves restarting go-server[1]. I remember during the DevCloud efforts we had published go-figure gem for the API wrapper stuff. Is it still available? i can get the gem from rubygems, but cant traceback its source. If not we should definitely write one,
Reply all
Reply to author
Forward
0 new messages