Deploy module from feature branch Eureka

Deploy module from feature branch Eureka

Deploy module from feature branch Eureka (development version of module(s) code)


Purpose

The development team needs to deploy/update a module from a feature branch to a Eureka environment.

This job builds a module from a specified feature branch, creates a Docker image, and deploys it to the selected Eureka namespace.


Deploy module from feature branch flow

Steps:

  1. Log in to Jenkins Dashboard

  2. Navigate to the job: deployModuleFromFeatureBranchEureka

  3. Click the Build with Parameters button on the left side

  4. Configure the following parameters:

Parameter

Required/Optional

Description

Parameter

Required/Optional

Description

MODULE_NAME

Required

Select the module to deploy

MODULE_BRANCH

Required

Select the feature branch to build from

MAVEN_ARGS

Optional

Maven build arguments (default: -DskipTests)

JAVA_VERSION

Optional

Java version to use for build (choices: 21, 17)

CLUSTER

Required

Select target Eureka cluster (e.g., edev, etesting)

NAMESPACE

Required

Select namespace within the cluster

CONFIG_TYPE

Required

Deployment config type for resource allocation: • development - for Dev cluster • testing - for Testing cluster • performance - for Perf cluster

FORCE_MVN_CACHE_REFRESH

Optional

Force Maven cache refresh (default: false)

CLEANUP_ENV

Optional

Delete karate tests tenants before deployment (default: true)

SIMPLIFIED

Optional

Use simplified deployment process (default: false) i.e. invoke /tenantAPI ONLY, without compiling new Eureka app, publishing app descriptor and so on. /tenantAPI of deployed module.

INVOKE_TENANT_API

Optional

Invoke /tenant API POST calls - only applicable when SIMPLIFIED is enabled (default: true)

  1. Click the Build button

  2. Wait for completion


Job Workflow

The job performs the following stages:

  1. Ini - Initializes build and retrieves feature branch commit hash

  2. Git Checkout - Checks out the module source code from the specified branch

  3. isRunning - Verifies the target environment is running and the module exists

  4. Pre-condition CleanUp - Optionally cleans up karate test tenants

  5. Maven/Gradle Compile - Builds the module (supports both Maven and Gradle builds)

  6. Docker Build and Push - Builds Docker image and pushes to ECR, uploads module descriptor to Eureka Registry

  7. Generate context - Retrieves existing tenants and applications for the module

  8. Retrieve module's sidecar - Identifies sidecar configuration if needed

Deployment Modes

Simplified Mode (SIMPLIFIED=true)

  • Update Module Image - Updates the deployment with the new image version

  • Invoke /tenant API POST calls - Optionally triggers tenant API for all affected tenants

Standard Mode (SIMPLIFIED=false)

  • Update App Descriptor - Registers new application descriptor with updated module version

  • Module Discovery - Enables new module version in discovery

  • Helm Deploy Module - Deploys new module version via Helm

  • Enable New App - Enables application descriptor for tenants in namespace

  • Remove Stale Resources - Cleans up old application descriptors and module versions


Build Tool Support

The job automatically detects and supports both:

  • Maven - builds using pom.xml

  • Gradle - builds using gradle.properties


Notes

  • Protected namespaces require kitfox approval before deployment

  • The job automatically checks for ECR repository existence and creates it if needed

  • Module descriptors are uploaded to the Eureka Module Registry

  • The job includes error handling with automatic cleanup on failure

  • For Gradle builds, the build directory is service/ subdirectory


Error Handling

The job includes comprehensive error handling:

  • Automatic cleanup of created resources on failure

  • Retry logic for entitlement conflicts

  • Tenant-specific cleanup when needed

  • Graceful handling of "cannot be removed" errors for active entitlements