Some checks reported errors
andreas-personal/AndysAdguardHomeBlockList/pipeline/head Something is wrong with the build of this commit
51 lines
1.2 KiB
Groovy
51 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 -b build-${BUILD_NUMBER}
|
|
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 checkout main
|
|
git pull --rebase
|
|
git merge build-${BUILD_NUMBER} --no-ff -m "Merge build ${BUILD_NUMBER}"
|
|
git push
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|