Selaa lähdekoodia

Tidy Jenkinsfile, add pipeline options

Enable BuildKit (needed for COPY --chmod), build retention, no concurrent
builds, a 30 minute timeout and timestamps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spencer Gardner 1 viikko sitten
vanhempi
commit
0b0c8cee4c
1 muutettua tiedostoa jossa 42 lisäystä ja 29 poistoa
  1. 42 29
      Jenkinsfile

+ 42 - 29
Jenkinsfile

@@ -1,31 +1,44 @@
-pipeline{
-	agent { label 'docker' }
-	triggers {
-		pollSCM('H * * * *')
-		cron('H H H * *')
-	}
-	stages{
+pipeline {
+    agent { label 'docker' }
+
+    options {
+        buildDiscarder(logRotator(numToKeepStr: '20'))
+        disableConcurrentBuilds()
+        timeout(time: 30, unit: 'MINUTES')
+        timestamps()
+    }
+
+    triggers {
+        pollSCM('H * * * *')
+        cron('H H H * *')
+    }
+
+    environment {
+        DOCKER_BUILDKIT = '1'
+    }
+
+    stages {
         stage('Build') {
-			steps {
-				script {
-					docker.withRegistry('https://docker.snppla.net', 'nexus_push'){
-						def customImage = docker.build("docker.snppla.net/snppla/deluge-web:${env.GIT_BRANCH}", "--pull ./")
-						customImage.push()
-					}
-				}
-			}
+            steps {
+                script {
+                    docker.withRegistry('https://docker.snppla.net', 'nexus_push') {
+                        def customImage = docker.build("docker.snppla.net/snppla/deluge-web:${env.GIT_BRANCH}", '--pull ./')
+                        customImage.push()
+                    }
+                }
+            }
         }
-	}
-	post {
-		success{
-			emailext body: "${env.BUILD_URL} was built", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Built Pipeline: ${currentBuild.fullDisplayName}"
-		}
-		failure{
-			emailext body: "Something is wrong with ${env.BUILD_URL}", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Failed Pipeline: ${currentBuild.fullDisplayName}"
-		}
-		fixed
-		{
-			emailext body: "The pipeline was fixed with ${env.BUILD_URL}", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Pipeline fixed: ${currentBuild.fullDisplayName}"
-		}
-	}
-}
+    }
+
+    post {
+        success {
+            emailext body: "${env.BUILD_URL} was built", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Built Pipeline: ${currentBuild.fullDisplayName}"
+        }
+        failure {
+            emailext body: "Something is wrong with ${env.BUILD_URL}", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Failed Pipeline: ${currentBuild.fullDisplayName}"
+        }
+        fixed {
+            emailext body: "The pipeline was fixed with ${env.BUILD_URL}", to: '$DEFAULT_RECIPIENTS', recipientProviders: [developers()], subject: "Pipeline fixed: ${currentBuild.fullDisplayName}"
+        }
+    }
+}