Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,40 @@ properties(

@Library("Infrastructure@DO-NOT-MERGE-FT-TIMEOUT-EXTENSION")

// ---------------------------------------------------------
// 🚦 Stage 0: File change check (SKIP if irrelevant)
// ---------------------------------------------------------
node {
stage('Check Relevant Changes') {
checkout scm

def changedFiles = sh(
script: "git diff --name-only HEAD~1 HEAD",
returnStdout: true
).trim().split("\n")

// ✅ Adjust these patterns to your needs
def triggers = [
~/^src\/.*/, // any file under src/
~/^app\/.*/, // any file under app/
~/^pom\.xml$/ // pom.xml specifically
]

def shouldBuild = changedFiles.any { file ->
triggers.any { pattern -> file ==~ pattern }
}

if (!shouldBuild) {
echo "No relevant changes detected. Skipping pipeline."
currentBuild.result = 'NOT_BUILT'
error("Stopping pipeline early.")
} else {
echo "Relevant changes found: ${changedFiles}"
}
}
}


def type = "java"
def product = "ccd"
def component = "data-store-api"
Expand Down