Skip to content

Gradle Project Setup

This guide covers setup and local usage for Arda’s Gradle-based component projects.

Install a recent version of git. Consider also installing gh, the GitHub CLI tool.

Install JVM 21 (Arda uses AWS Corretto). On a Mac, verify with java --version. Use JAVA_HOME or sdkman to manage the active version.

Install and launch Docker Desktop. Enable the Kubernetes cluster if local deployment using Helm is desired.

Install the 1Password CLI.

Warning: Mind the token expiry date. Gradle builds will fail after expiry and the token will need to be renewed.

  1. Create a GitHub personal access token (classic) with the single scope read:package.

  2. Create ~/.gradle/gradle.properties:

    gpr.user=<github-handle>
    gpr.key=<github-token>
  3. Create a 1Password note named GH_OCI_RO with the password set to your GitHub handle, a colon :, and a PAT with read access to the GitHub Docker registry.

CommandEffect
./gradlew cleanClean all generated artifacts
./gradlew buildValidate, build, and test all artifacts
./gradlew helmRenderRender Helm templates for all defined purposes
Terminal window
op run --env-file 1Password.env -- ./gradlew helmInstallToLocal
echo "Application port:"
kubectl --context docker-desktop get service application-exposed-port \
--namespace=accounts \
--output=jsonpath='{.spec.ports[0].nodePort}{"\n"}'
echo "Postgres port:"
kubectl --context docker-desktop get service postgres-exposed-port \
--namespace=accounts \
--output=jsonpath='{.spec.ports[0].nodePort}{"\n"}'

Every push to origin triggers a build.

When the build runs on a protected branch (or a branch with a feature version), versioned artifacts are published and a deployment to the first purpose (dev) is triggered. Subsequent purpose deployments follow automatically unless gated.

GitHub Actions Workflows

The version annotation appears in the workflow summary:

Workflow Version Annotation

Deployments to stage and prod are gated. To open the gate:

  1. Navigate to GitHub Actions for the repository.
  2. Find and run the workflow Deployment Requests Approval.
  3. Provide the chart version (visible in the failed deployment’s summary or annotations).

Deployment Approval Workflow

Deploy Annotations

Alternatively, trigger from the command line:

Terminal window
gh workflow run "Deployment Requests Approval" \
--ref main \
-f chart_version=0.6.0 \
-f purpose=stage

The artifact version is the topmost version defined in CHANGELOG.md, qualified with the CI run ID, number, and attempt for feature branch builds.