Some checks failed
		
		
	
	andreas-personal/AndysAdguardHomeBlockList/pipeline/head There was a failure building this commit
				
			
		
			
				
	
	
		
			78 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
| #!groovy
 | |
| 
 | |
| pipeline {
 | |
|     agent {
 | |
|         label 'linux'
 | |
|     }
 | |
|     stages {
 | |
|         stage('Checkout') {
 | |
|             when {
 | |
|                 beforeAgent true;
 | |
|                 branch 'main'
 | |
|             }
 | |
|             steps {
 | |
|                 // dir ('build-dir') {
 | |
|                 //     checkout poll: false, scm: scmGit([
 | |
|                 //         branches: [[name: 'main']],
 | |
|                 //         userRemoteConfigs: [[credentialsId: 'gitea-jenkins-user-token', url: 'https://gitea.fahrecker.com/andreas-personal/AndysAdguardHomeBlocklist.git']]
 | |
|                 //     ])
 | |
|                 //     sh 'git checkout main'
 | |
|                 //     sh 'pwd'
 | |
|                 // }
 | |
|                 sh 'git checkout main'
 | |
|             }
 | |
|         }
 | |
|         stage('NPM Install') {
 | |
|             when {
 | |
|                 beforeAgent true;
 | |
|                 branch 'main'
 | |
|             }
 | |
|             steps {
 | |
|                 // dir ('build-dir') {
 | |
|                     sh 'pwd'
 | |
|                     sh 'npm clean-install'
 | |
|                 // }
 | |
|             }
 | |
|         }
 | |
|         stage('Compile Adblock List') {
 | |
|             when {
 | |
|                 beforeAgent true;
 | |
|                 branch 'main'
 | |
|             }
 | |
|             steps {
 | |
|                 // 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') {
 | |
|             when {
 | |
|                 beforeAgent true;
 | |
|                 branch 'main'
 | |
|             }
 | |
|             steps {
 | |
|                 // dir ('build-dir') {
 | |
|                     withCredentials([
 | |
|                         gitUsernamePassword(credentialsId: 'gitea-jenkins-user-token')
 | |
|                     ]) {
 | |
|                         sh '''
 | |
|                             git pull origin main
 | |
|                             git push
 | |
|                         '''
 | |
|                     }
 | |
|                 // }
 | |
|             }
 | |
|         }
 | |
|     }
 | |
|     post {
 | |
|         always {
 | |
|             deleteDir()
 | |
|         }
 | |
|     }
 | |
| }
 |