---
description: Useful gradle tasks used during development of GoCD.
keywords: gocd new api, gocd docker images, open source contributions
---

## 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:

```bash
./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,

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

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

```bash
./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,

```bash
./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:

```bash
./gradlew --parallel --max-workers 2 docker:gocd-agent:assemble -PdockerbuildAgentZipLocationn=/path/to/agent.zip
```
Document useful gradle tasks that are generally used during development of gocd.
Document useful gradle tasks that are generally used during development of gocd.
