Skip to content

Commit

Permalink
ci: skip build if only documentation files were changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdibi committed Dec 5, 2024
1 parent 27b8caa commit 9e2dcc5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
def onlyDocsChanged() {
if (!env.CHANGE_TARGET) {
echo "CHANGE_TARGET not set. Skipping check"
return false
}

def changedFiles = currentBuild.changeSets.collect { it.items }.flatten().collect { it.affectedPaths }
echo "Changed files: ${changedFiles}" // Debug

return changedFiles.every { it.endsWith(".md") || it.endsWith(".txt") }
}

node {
properties([
disableConcurrentBuilds(abortPrevious: true),
Expand All @@ -15,6 +27,13 @@ node {
}
}

// Skip build if only documentation files (i.e. *.md and *.txt) have changed
if (onlyDocsChanged()) {
echo "Skipping build for documentation changes"
currentBuild.result = 'SUCCESS'
return
}

stage('Build') {
timeout(time: 2, unit: 'HOURS') {
dir("kura") {
Expand Down
6 changes: 6 additions & 0 deletions kura/javaConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"projects": [
"org.eclipse.kura.ai.triton.server"
],
"targetPlatform": []
}

0 comments on commit 9e2dcc5

Please sign in to comment.