This repository has been archived on 2024-08-07. You can view files and clone it, but cannot push or open issues or pull requests.
Andreas Fahrecker 189bf4f373
Some checks failed
andreas-personal/AndysAdguardHomeBlockList/pipeline/head There was a failure building this commit
Jenkins Maybe Fix Git Error
2024-04-10 04:16:02 +02:00

52 lines
1.2 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 main
mkdir -p dist
npm run compile
git stash
'''
}
}
stage('git push') {
when {
beforeAgent true;
branch 'main'
}
steps {
withCredentials([
gitUsernamePassword(credentialsId: 'gitea-jenkins-user-token')
]) {
sh '''
git pull --rebase
git stash pop || true
git add .
git commit -m "Update Compiled Adblock List"
git push
'''
}
}
}
}
}