continuous-integrationgo-cd

Go CD failure message available in environment


There is a list of env variables available for GoCD at: https://docs.gocd.org/current/faq/environment_variables.html

However I'm looking for something like: GO_BUILD_ERROR or similar.

I would like to have the failure reason or message when a build fails to pass this to an external script or message.

There seems to be nothing in the documentation.


Solution

  • GoCD doesn't have any such variables. The reason I feel is mostly because GoCD is very generic in terms of what commands constitute a build for a material. You might want to parse the logs manually to figure that out.

    Also in the context of GoCD environment variables are used as input to the stages and not as output from them. If you're planning to build a plugin / wrapper for the commands that run consider storing them as properties in the jobs that way they can also be queried upon later if required.