diff --git a/Jenkinsfile b/Jenkinsfile index d0e2023..cf62480 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,8 +26,10 @@ pipeline { branch 'main' } steps { - sh 'pwd' - sh 'npm clean-install' + dir ('build-dir') { + sh 'pwd' + sh 'npm clean-install' + } } } stage('Compile Adblock List') { @@ -36,12 +38,14 @@ pipeline { branch 'main' } steps { - sh ''' - mkdir -p out - npm run compile:test - git add out/andysadguardhomeblocklist.txt - git commit -m "Update Compiled Adblock List" - ''' + dir ('build-dir') { + sh ''' + mkdir -p out + npm run compile:test + git add out/andysadguardhomeblocklist.txt + git commit -m "Update Compiled Adblock List" + ''' + } } } stage('git push') { @@ -50,13 +54,15 @@ pipeline { branch 'main' } steps { - withCredentials([ - gitUsernamePassword(credentialsId: 'gitea-jenkins-user-token') - ]) { - sh ''' - git pull - git push -u origin main - ''' + dir ('build-dir') { + withCredentials([ + gitUsernamePassword(credentialsId: 'gitea-jenkins-user-token') + ]) { + sh ''' + git pull + git push -u origin main + ''' + } } } }