Some checks failed
andreas-personal/AndysAdguardHomeBlockList/pipeline/head There was a failure building this commit
53 lines
1.3 KiB
Groovy
53 lines
1.3 KiB
Groovy
#!groovy
|
|
|
|
pipeline {
|
|
agent {
|
|
label 'linux'
|
|
}
|
|
stages {
|
|
stage('NPM Install') {
|
|
when {
|
|
beforeAgent true;
|
|
branch 'main'
|
|
}
|
|
steps {
|
|
sh 'npm clean-install'
|
|
}
|
|
}
|
|
stage('Compile Adblock List') {
|
|
when {
|
|
beforeAgent true;
|
|
branch 'main'
|
|
}
|
|
steps {
|
|
sh '''
|
|
git checkout -b build-${BUILD_NUMBER}
|
|
mkdir -p dist
|
|
npm run compile
|
|
git add .
|
|
git commit -m "Update Compiled Adblock List"
|
|
'''
|
|
}
|
|
}
|
|
stage('git push') {
|
|
when {
|
|
beforeAgent true;
|
|
branch 'main'
|
|
}
|
|
steps {
|
|
withCredentials([
|
|
gitUsernamePassword(credentialsId: 'gitea-jenkins-user-token')
|
|
]) {
|
|
sh '''
|
|
git checkout main
|
|
git rebase --abort
|
|
git pull --rebase
|
|
git merge build-${BUILD_NUMBER} --no-ff -m "Merge build ${BUILD_NUMBER}"
|
|
git push
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|