Deploy Folio with custom Sidecar module versions

Deploy Folio with custom Sidecar module versions

As of 6/10/2025 build approach of Sidecar has been changed (platform-complete repo branching is not required any more)

Target job: deploySidecarFromFeatureBranch (Build sidecar from any branch)

Parameters

The pipeline accepts the following parameters:

  1. MODULE_BRANCH - Branch name from folio-module-sidecar repository to build

  2. NATIVE - Boolean parameter (if selected/clicked, native SC image will be built)

  3. FORCE_MVN_CACHE_REFRESH - Boolean parameter to force Maven cache refresh (adds -U flag)

  4. REFRESH_PARAMETERS - Standard parameter to refresh the pipeline parameters

Scheduled Execution

The pipeline runs automatically on a schedule:

  • Runs daily at 10 PM (22:00 UTC)

  • Default parameters: MODULE_BRANCH=master, NATIVE=true, FORCE_MVN_CACHE_REFRESH=false

Build Process

The pipeline performs the following steps:

1. Initialization

  • Retrieves the branch commit hash (first 7 characters)

  • Sets build name and description with native/non-native flag, branch name, and hash

2. Git Checkout

  • Clones the specified branch from folio-module-sidecar repository

  • Uses shallow clone (depth: 50) for faster checkout

  • Includes submodules

3. Maven Compile

  • Uses Java 21 (JAVA_LATEST_VERSION)

  • Reads version from pom.xml and appends commit hash:

    • For native builds: version-native.{hash}

    • For regular builds: version-SNAPSHOT.{hash}

  • Maven arguments:

    • Native build: clean install -DskipTests -Pnative -Dnative.march=-march=compatibility

    • Regular build: clean package -DskipTests

    • Optional: -U flag when FORCE_MVN_CACHE_REFRESH is enabled

4. Docker Build and Push

  • Checks ECR repository existence

  • Uses Kaniko for building container images

  • Dockerfile selection:

    • Native: docker/Dockerfile.native-micro

    • Regular: Default Dockerfile

  • Pushes image to ECR with version tag

  • Archives artifact file: folio-module-sidecar-{version}.txt

5. Error Handling

  • On failure, sends notification to #folio-eureka-support Slack channel

  • Build result set to FAILURE with error description

Deployment

Once the sidecar build job succeeds, to deploy the newly built Java-Based or Native Sidecar image, select the SC_NATIVE parameter in createNamespaceFromBranch job (applicable ONLY to EUREKA platform).

Depending on which type of Sidecar image was built last, that image will be used for environment provisioning (native or java-based docker image).