From 64d96165fef7324f40904f54a9a6c015caec020c Mon Sep 17 00:00:00 2001 From: Andreas Fahrecker Date: Wed, 10 Apr 2024 01:34:07 +0200 Subject: [PATCH] Test new Jenkins File --- Jenkinsfile | 57 ++++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f34dafe..b4b5982 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,40 +1,35 @@ #!groovy pipeline { - agent none - + agent { + label 'linux' + } + when { + beforeAgent true; + branch 'main' + } stages { - stage('Compile List and Push to Gitea') { - when { - beforeAgent true; - branch 'main' + stage('NPM Install') { + steps { + sh 'npm clean-install' } - agent { - label 'linux' + } + stage('Compile Adblock List') { + steps { + sh 'npm run compile' } - stages { - stage('NPM Install') { - steps { - sh 'npm clean-install' - } - } - stage('Compile Adblock List') { - steps { - sh 'npm run compile' - } - } - stage('git push') { - steps { - withCredentials([ - gitUsernamePassword(credentialsId: 'gitea-jenkins-user-token') - ]) { - sh ''' - git add . - git commit -m "Update Compiled Adblock List" - git push - ''' - } - } + } + stage('git push') { + steps { + withCredentials([ + gitUsernamePassword(credentialsId: 'gitea-jenkins-user-token') + ]) { + sh ''' + git checkout main + git add . + git commit -m "Update Compiled Adblock List" + git push + ''' } } }