2.5 Other useful gradle tasks used in development

2.5.1 New GoCD API

In order to add a new api, many components need to be updated. The gradle task is:

./gradlew newApi -PapiName=<api_name> -PapiVersion=<version>

This task does the following:

  • Creates a new module api/api-<api_name>-<version>
  • Updates applicationContext-global.xml to include the new module under component scan.
  • Updates .gitignore with the directories that are not to be committed.
  • Updates settings.gradle to include the new module.

2.5.2 Docker images

Once the gocd-(server|agent) zip is created by ./gradlew serverGenericZip agentGenericZip, then, this can be used for building the docker server or agent images.

Docker GoCD server

In order to build from locally built zip file,

./gradlew docker:gocd-server:assemble -PdockerBuildLocalZip

In order to specify a custom zip to use while building the docker image:

./gradlew docker:gocd-server:assemble -PdockerbuildServerZipLocation=/path/to/server.zip

Docker GoCD Agent

In order to build all the agent images from locally built zip file,

./gradlew --parallel --max-workers 2 docker:gocd-agent:assemble -PdockerBuildLocalZip

In order to specify a custom zip to use while building the all the agent docker images:

./gradlew --parallel --max-workers 2 docker:gocd-agent:assemble -PdockerbuildAgentZipLocationn=/path/to/agent.zip

results matching ""

    No results matching ""