Test
Some checks failed
andreas-personal/AndysAdguardHomeBlockList/pipeline/head There was a failure building this commit

This commit is contained in:
Andreas Fahrecker 2024-04-10 17:42:38 +02:00
parent 9d2501cd4e
commit 1196994f0d

43
Jenkinsfile vendored
View File

@ -8,26 +8,31 @@ pipeline {
stage('Checkout') { stage('Checkout') {
when { when {
beforeAgent true; beforeAgent true;
allOf { branch 'main'
branch 'main'
not {
changeset 'out/andysadguardhomeblocklist.txt'
}
}
} }
steps { steps {
sh 'git checkout main' sh 'git checkout main'
} }
} }
stage('Check last Commit') {
when {
beforeAgent true;
branch 'main'
}
steps {
script {
// Replace 'Jenkins' with the name Jenkins uses to commit
if (sh(script: 'git log -1 --pretty=format:"%an"', returnStdout: true).trim() == 'Jenkins') {
currentBuild.result = 'ABORTED'
error('Last commit was by Jenkins, skipping build')
}
}
}
}
stage('NPM Install') { stage('NPM Install') {
when { when {
beforeAgent true; beforeAgent true;
allOf { branch 'main'
branch 'main'
not {
changeset 'out/andysadguardhomeblocklist.txt'
}
}
} }
steps { steps {
sh 'npm clean-install' sh 'npm clean-install'
@ -36,12 +41,7 @@ pipeline {
stage('Compile Adblock List') { stage('Compile Adblock List') {
when { when {
beforeAgent true; beforeAgent true;
allOf { branch 'main'
branch 'main'
not {
changeset 'out/andysadguardhomeblocklist.txt'
}
}
} }
steps { steps {
sh 'mkdir -p out' sh 'mkdir -p out'
@ -55,12 +55,7 @@ pipeline {
stage('git push') { stage('git push') {
when { when {
beforeAgent true; beforeAgent true;
allOf { branch 'main'
branch 'main'
not {
changeset 'out/andysadguardhomeblocklist.txt'
}
}
} }
steps { steps {
withCredentials([ withCredentials([