From 2b84326d8061b6a0fca5f9b5151d548f98e2bb78 Mon Sep 17 00:00:00 2001 From: Andreas Fahrecker Date: Wed, 10 Apr 2024 16:55:19 +0200 Subject: [PATCH] Jenkins Test --- Jenkinsfile | 23 +++++++++++++++-------- package.json | 5 +++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8644257..8f47b20 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,18 @@ pipeline { label 'linux' } stages { + stage('Checkout') { + when { + beforeAgent true; + branch 'main' + } + steps { + checkout poll: false, scm: scmGit([ + branches: [[name: 'main']], + userRemoteConfigs: [[credentialsId: 'gitea-jenkins-user-token', url: 'https://gitea.fahrecker.com/andreas-personal/AndysAdguardHomeBlocklist.git']] + ]) + } + } stage('NPM Install') { when { beforeAgent true; @@ -21,10 +33,9 @@ pipeline { } steps { sh ''' - git checkout -b build-${BUILD_NUMBER} mkdir -p dist - npm run compile - git add . + npm run compile:test + git add out/andysadguardhomeblocklist.txt git commit -m "Update Compiled Adblock List" ''' } @@ -39,11 +50,7 @@ pipeline { gitUsernamePassword(credentialsId: 'gitea-jenkins-user-token') ]) { sh ''' - git checkout main - git rebase --abort - git pull --rebase - git merge build-${BUILD_NUMBER} --no-ff -m "Merge build ${BUILD_NUMBER}" - git push + git push -u origin main ''' } } diff --git a/package.json b/package.json index 750bf25..9a8115d 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,9 @@ "description": "A blocklist for Adguard Home", "main": "index.js", "scripts": { - "compile": "hostlist-compiler -c configuration.json -o dist/andysadguardhomeblocklist.txt", - "compile:verbose": "hostlist-compiler -c configuration.json -o dist/andysadguardhomeblocklist.txt -v" + "compile": "hostlist-compiler -c configuration.json -o out/andysadguardhomeblocklist.txt", + "compile:verbose": "hostlist-compiler -c configuration.json -o out/andysadguardhomeblocklist.txt -v", + "compile:test": "echo 'Test' > out/andysadguardhomeblocklist.txt" }, "repository": { "type": "git",