Installation and Configuration
Installing develocityctl
develocityctl is distributed in two forms:
-
As an executable JAR file
-
As a Docker image
Installing the JAR File
Prerequisites
To run the develocityctl JAR, you will need a Java 21 or newer available locally on the machine you want to use the CLI on.
For standalone installations, develocityctl must be installed on the Develocity host to interact with the Develocity instance (for example, the support-bundle and system restart commands).
|
Install the Binary With Curl
-
Download the latest release to and save it as develocityctl.jar:
curl -L -o develocityctl.jar https://docs.gradle.com/downloads/develocityctl/develocityctl-1.19.jarTo download a specific version, see JAR Downloads for the download links and follow the same steps with replacing the version of
develocityctl. -
Validate the binary (optional)
Download the checksum file:
curl -L -o develocityctl-1.19.jar.sha256 https://docs.gradle.com/downloads/develocityctl/develocityctl-1.19.jar.sha256Validate the binary against the checksum file:
echo "$(cat develocityctl-1.19.jar.sha256) develocityctl.jar" | sha256sum --checkIf valid, the output is:
Outputdevelocity: OK
If the check fails,
sha256exits with nonzero status and prints output similar to:Outputdevelocityctl: FAILED sha256sum: WARNING: 1 computed checksum did NOT match
Download the same version of the binary and checksum.
3 Install develocityctl
sudo mv develocityctl.jar /opt/gradle/develocityctl/develocityctl.jar
Optional: Create a shell alias
You can create a shell alias to make it easier to invoke develocityctl.
🔍 Steps to create a shell alias
-
Set up a shell alias to run the
develocityctlJAR file.-
For Bash, save the following alias to your
.bashrcor.bash_profilefile -
For Zsh, save the following alias to your
.zshrcfile -
For other shells, save the following alias to the appropriate configuration file
-
-
Load the alias into your current shell session by running
source ~/.bashrcorsource ~/.zshrc(or source the appropriate file for your shell).Example:
alias develocityctl="java -jar /opt/gradle/develocityctl/develocityctl.jar" -
Verify
develocityctlworks using the alias you created. You should see a list of available commands.develocityctl
Prerequisites
To run the develocityctl Docker image from a Docker container, you will need:
-
A Docker runtime and CLI tools available
-
A machine with access to pull the
gradle/develocityctlimage from Docker Hub, or to have pulled it into an accessible registry
For standalone installations, develocityctl must be installed on the Develocity host in order to interact with the Develocity instance (use commands like the support-bundle and system restart commands).
|
Installation steps
-
Pull the Docker image from Docker Hub:
docker pull gradle/develocityctl -
Verify
develocityctlis installed using the function you created. You should see a list of available commands.docker run --rm -it gradle/develocityctl
Optional: Create a shell function
You can create a shell function to make it easier to invoke develocityctl.
🔍 Steps to create a shell function
-
Set up a shell function to run the
develocityctlDocker image.-
For Bash, save the following function to your
.bashrcor.bash_profilefile -
For Zsh, save the following function to your
.zshrcfile -
For other shells, save the following function to the appropriate configuration file
Example:
function develocityctl() { docker run --rm -it \ -v "${HOME}/.kube/config:/kube-config:ro" \(1) -v "${PWD}:/home" \(2) gradle/develocityctl \(3) "$@" }1 This makes your local Kubernetes client configuration available to the Docker container. Adjust this if the config is stored in a different location. 2 Mount the current directory into the Docker container. See Working With Files When Using the Docker Image. 3 A specific version of the tool can be selected by appending a tag. E.g. gradle/develocityctl:1.19.latestwill be used when no tag is provided (as in the example above).If running on a platform other than linux/amd64 (for example a Mac with Apple silicon), you may see the following warning when running
develocityctl:OutputWARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
You can safely ignore the warning, or you can suppress the warning by adding
--platform linux/amd64to thedocker runcommand in the shell function.
-
-
Load the function into your current shell session by running
source ~/.bashrcorsource ~/.zshrc(or source the appropriate file for your shell). -
Invoke the shell function to verify it works. You should see a list of available commands.
develocityctl
Working With Files When Using the Docker Image
A Docker container by default cannot access your local filesystem. Instead, it is possible to mount a local directory to a path inside the container as a volume.
Some commands need to read or write files from the local filesystem. It is necessary to mount files or directories into the container in these cases.
The tool executes in the /home directory inside the container.
Thus, mounting a directory to /home makes files in that directory available to the tool, and it will write files inside that directory by default.
Mounting a directory is achieved by adding a -v host-path:container-path option to the Docker command.
The optional shell function mounts the current directory to the home directory inside the container. This works well for most commands. For some commands, you might need to mount a different directory or file. In these cases, you may need to edit the function, or invoke Docker directly.
Here is an example of how to run the support-bundle command and save the support bundle to a directory called bundles in your home directory:
docker run --rm -it \
-v "${HOME}/.kube/config:/kube-config:ro" \
-v "${HOME}/bundles:/home" \(1)
gradle/develocityctl \
--kube-ns=develocity \
support-bundle
| 1 | Mounts the ${HOME}/bundles directory to the /home directory inside the container.
Use -v "${PWD}:/home" instead if you want to save the support bundle to the current working directory. |
Many commands have options to accept input from standard input or to produce their output to standard output.
See the help text for a command by running it with --help to see if this is available for a given command.
|
Connecting to Your Develocity Instance
Connecting to a Standalone Develocity Instance
If you are running develocityctl using the JAR file, it will automatically detect the Standalone Develocity instance running on the same host by looking at the default Kubernetes configuration file (~/.kube/config).
If you are running develocityctl using the Docker image, then you need to mount default Kubernetes configuration file at /kube-config inside the container
docker run --rm -it \
-v "${HOME}/.kube/config:/kube-config:ro" \(1)
gradle/develocityctl \
system default-system-password
| 1 | Example of mounting the default Kubernetes configuration file into the correct location inside the container. Adjust this if the config is stored in a different location. |
Providing the default Kubernetes configuration is all that’s needed for develocityctl to connect to the Standalone Develocity instance.
The optional shell function for running develocityctl with Docker already mounts the default Kubernetes configuration file into the container.
|
If you used a namespace other than the default, you may need to specify the namespace of the Develocity instance using the --kube-ns option.
|
Connecting to a Kubernetes Develocity Instance
To connect to the Kubernetes cluster into which Develocity has been installed, the tool needs to discover or be provided with connection details.
Using the Default Context From the Environment
Kubernetes client configuration is usually stored in the ${HOME}/.kube/config file.
If a default context is configured there, the tool will detect this and attempt to connect to that cluster.
To check which contexts are available, and which is the default, run this command:
kubectl config get-contexts
It is possible to set the default context:
kubectl config use-context my-example-context-name
Specifying the Context by Name
If there is no default set, or if you want to select the context to use without altering the local environment, it can be specified as an option:
-
JAR
-
Docker
-
Alias
java -jar /opt/gradle/develocityctl/develocityctl.jar --kube-ctx=my-example-context-name
docker run -it --rm \
-v "${HOME}/.kube/config:/kube-config:ro" \
-v "${PWD}:/home" \
gradle/develocityctl \
--kube-ctx=my-example-context-name
develocityctl --kube-ctx=my-example-context-name
Specifying the Kubernetes Cluster by URL and Token
If running on a machine without a local Kubernetes client configuration set up, it’s possible to instead connect to a cluster by providing its URL and an authentication token:
-
JAR
-
Docker
-
Alias
java -jar /opt/gradle/develocityctl/develocityctl.jar \
--kube-url=https://kube-cluster.example.com:1234 --kube-token=ABCD1234
docker run -it --rm \
-v "${PWD}:/home" \
gradle/develocityctl \
--kube-url=https://kube-cluster.example.com:1234 --kube-token=ABCD1234
develocityctl --kube-url=https://kube-cluster.example.com:1234 --kube-token=ABCD1234
Specifying the Namespace
If using a locally configured context, a default namespace may be configured. If so, the tool will look for a Develocity instance in that namespace.
To check if your current context has a default namespace set, run this command:
kubectl config view -o jsonpath='{..namespace}'
The namespace can be set as the default for the current context by running this command:
kubectl config set-context --current --namespace=my-example-namespace
If there is no current context, or if there is but there is no default namespace, or if Develocity is on a different namespace to the default, you can specify the namespace to use as an argument to the tool:
-
JAR
-
Docker
-
Alias
java -jar /opt/gradle/develocityctl/develocityctl.jar --kube-ns=my-example-namespace
docker run -it --rm \
-v "${HOME}/.kube/config:/kube-config:ro" \
-v "${PWD}:/home" \
gradle/develocityctl \
--kube-ns=my-example-namespace
develocityctl --kube-ns=my-example-namespace
Updating the JAR File Shell Alias
If you created an alias for develocityctl, then you can update the alias to include the connection flags.
For example, to connect to a Develocity instance in the develocity namespace, you can update the alias to include the --kube-ns flag:
alias develocityctl="java -jar /opt/gradle/develocityctl/develocityctl.jar --kube-ns=my-example-namespace"
Updating the Docker Image Shell Function
If you created a shell function for develocityctl, then you can update the shell function to include the connection flags.
For example, to connect to a Develocity instance in the develocity namespace, you can update the function to include the --kube-ns flag:
function develocityctl() {
docker run --rm -it \
--platform linux/amd64 \
-v "${HOME}/.kube/config:/kube-config:ro" \
-v "${PWD}:/home" \
gradle/develocityctl \
--kube-ns=my-example-namespace \(1)
"$@"
}
| 1 | Add the --kube-ns flag to specify the namespace. |
Verifying the Connection
To verify develocityctl can connect to the Develocity instance, run the system get-default-system-password command:
-
JAR
-
Docker
-
Alias
java -jar /opt/gradle/develocityctl/develocityctl.jar system get-default-system-password
docker run -it --rm \
-v "${HOME}/.kube/config:/kube-config:ro" \
-v "${PWD}:/home" \
gradle/develocityctl \
system get-default-system-password
develocityctl system get-default-system-password
If the connection is successful, the default system password will be printed to the console. Otherwise, an error message will be displayed.
If you have any questions or need any assistance contact the Develocity support team or your customer success representative.