Automating Docker server accepting agents using API (and others)

24 views
Skip to first unread message

Nikola Radovanovic

unread,
Apr 15, 2021, 9:45:54 AM4/15/21
to go-cd
Hi,
today I played a little bit with GoCD and ended up creating one Docker compose with PostgreSql, GoCD server and two GoCD agents. 

Now I have couple of questions, but first I would like to know if it is possible using the API (or any other means) to accept automatically both (or more agents) running on my local Docker network? In case docker is restarted, there will be new agents started and I would like not to have to accept them manually.

Also, couple of others:
  1. I guess LDAP is supported via plugin and that it can be configured using API
  2. Is it possible to have conditional builds, for example - in case unit-tests fails, break the build. If succeeds, increment version and continue (but don't commit version to Git)
  3. Are private Docker, PyPI and Git repositories supported
Thank you kindly.

Best regards

Ashwanth Kumar

unread,
Apr 15, 2021, 10:39:31 AM4/15/21
to go...@googlegroups.com
For the auto approval of agents you might want to check the manual at https://docs.gocd.org/current/advanced_usage/agent_auto_register.html


--
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/d9b6e771-f02c-4905-bc67-3725f2ddeae3n%40googlegroups.com.

Sriram Narayanan

unread,
Apr 16, 2021, 10:08:34 AM4/16/21
to go-cd
On Thursday, April 15, 2021 at 9:45:54 PM UTC+8 niko...@gmail.com wrote:
Hi,
today I played a little bit with GoCD and ended up creating one Docker compose with PostgreSql, GoCD server and two GoCD agents. 

Now I have couple of questions, but first I would like to know if it is possible using the API (or any other means) to accept automatically both (or more agents) running on my local Docker network? In case docker is restarted, there will be new agents started and I would like not to have to accept them manually.

Also, couple of others:
  1. I guess LDAP is supported via plugin and that it can be configured using API
  2. Is it possible to have conditional builds, for example - in case unit-tests fails, break the build. If succeeds, increment version and continue (but don't commit version to Git)
When you use the words "increment version", are you referring to the pipeline run number? If so, then that number is the run number of the pipeline and is auto-incremented whenever the pipeline is triggered.

What you have described (continue if the unit-tests succeed) is a part of pipeline design, where within a pipeline, one stage would run a job that runs the unit tests, and the next stage would run whatever job you want to run after the unit tests. Note : It is extremely easy to run multiple jobs in parallel within a stage - provided there are agents available for those jobs.
 
  1. Are private Docker, PyPI and Git repositories supported

GoCD has native support for various materials (where GoCD will poll those material sources and trigger pipelines). 
The various materials supported out of the box can be seen here (https://github.com/gocd/gocd/tree/master/server/src/main/java/com/thoughtworks/go/server/service/materials) and that includes Git repositories.

You can run the respective command line tools via shell scripts within a pipeline, where the pipeline can either be triggered via API, or polls a source code material for changes, or is manually triggered.

Nikola Radovanovic

unread,
Apr 16, 2021, 2:45:38 PM4/16/21
to go...@googlegroups.com
Thank you,
we are currently considering GoCD (my proposal) and CirlceCi (manager proposal). Tbf I like GoCD better.

Best regards

--
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/xT-tLj7rTjI/unsubscribe.
To unsubscribe from this group and all its topics, 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/a667d082-9377-4bcd-a38d-b487db3668f1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages