63 lines
1.5 KiB
Groovy
63 lines
1.5 KiB
Groovy
#!groovy
|
|
|
|
pipeline {
|
|
agent {
|
|
label 'linux'
|
|
}
|
|
stages {
|
|
stage('Checkout') {
|
|
when {
|
|
beforeAgent true;
|
|
branch 'main'
|
|
}
|
|
steps {
|
|
sh 'git checkout main'
|
|
}
|
|
}
|
|
stage('NPM Install') {
|
|
when {
|
|
beforeAgent true;
|
|
branch 'main'
|
|
}
|
|
steps {
|
|
sh 'npm clean-install'
|
|
}
|
|
}
|
|
stage('Compile Adblock List') {
|
|
when {
|
|
beforeAgent true;
|
|
branch 'main'
|
|
}
|
|
steps {
|
|
sh 'mkdir -p out'
|
|
sh 'rm out/andysadguardhomeblocklist.txt'
|
|
sh '''
|
|
git add out/andysadguardhomeblocklist.txt
|
|
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 pull origin main
|
|
git push
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
deleteDir()
|
|
}
|
|
}
|
|
}
|