#1262 Make pipeline job options consistent
Merged 4 years ago by mprahl. Opened 4 years ago by mikeb.
mikeb/fm-orchestrator consistent-options  into  master

@@ -42,6 +42,7 @@ 

      timestamps()

      timeout(time: 120, unit: 'MINUTES')

      buildDiscarder(logRotator(numToKeepStr: '10'))

+     disableConcurrentBuilds()

      skipDefaultCheckout()

    }

    environment {

@@ -1,6 +1,10 @@ 

  // Use scripted syntax because CIBuildTrigger currently doesn't support the declarative syntax

  properties([

+   timestamps(),

+   timeout(time: 30, unit: 'MINUTES'),

+   buildDiscarder(logRotator(numToKeepStr: '10')),

    disableConcurrentBuilds(),

+   skipDefaultCheckout(),

    pipelineTriggers([

      // example: https://github.com/jenkinsci/jms-messaging-plugin/blob/9b9387c3a52f037ba0d019c2ebcf2a2796fc6397/src/test/java/com/redhat/jenkins/plugins/ci/integration/AmqMessagingPluginIntegrationTest.java

      [$class: 'CIBuildTrigger',

@@ -38,6 +38,9 @@ 

    options {

      timestamps()

      timeout(time: 30, unit: 'MINUTES')

+     buildDiscarder(logRotator(numToKeepStr: '10'))

+     disableConcurrentBuilds()

+     skipDefaultCheckout()

    }

    environment {

      PIPELINE_NAMESPACE = readFile(file: '/run/secrets/kubernetes.io/serviceaccount/namespace').trim()

@@ -41,6 +41,7 @@ 

      timestamps()

      timeout(time: 60, unit: 'MINUTES')

      buildDiscarder(logRotator(numToKeepStr: '10'))

+     disableConcurrentBuilds()

      skipDefaultCheckout()

    }

    environment {

@@ -123,6 +123,10 @@ 

              }

              options {

                timestamps()

+               timeout(time: 60, unit: 'MINUTES')

+               buildDiscarder(logRotator(numToKeepStr: '10'))

+               disableConcurrentBuilds()

+               skipDefaultCheckout()

              }

              environment {

                PIPELINE_NAMESPACE = readFile('/run/secrets/kubernetes.io/serviceaccount/namespace').trim()

@@ -1,6 +1,10 @@ 

  // Use scripted syntax because CIBuildTrigger currently doesn't support the declarative syntax

  properties([

+   timestamps(),

+   timeout(time: 30, unit: 'MINUTES'),

+   buildDiscarder(logRotator(numToKeepStr: '10')),

    disableConcurrentBuilds(),

+   skipDefaultCheckout(),

    pipelineTriggers([

      // example: https://github.com/jenkinsci/jms-messaging-plugin/blob/9b9387c3a52f037ba0d019c2ebcf2a2796fc6397/src/test/java/com/redhat/jenkins/plugins/ci/integration/AmqMessagingPluginIntegrationTest.java

      [$class: 'CIBuildTrigger',

Set a consistent set of options on Jenkins pipeline jobs. This includes timestamps,
reasonable timeouts, saving only the last 10 builds (to avoid filling up the disk
of the Jenkins master), disabling concurrent builds (to avoid hitting quota limits),
and skipping the default checkout (all jobs that need the source call checkout()
explicitly).

Build d80316e FAILED!
Rebase or make new commits to rebuild.

I have no big jenkins knowledge, but what you did here looks sane to me ;)

Commit 79ba221 fixes this pull-request

Pull-Request has been merged by mprahl

4 years ago

Pull-Request has been merged by mprahl

4 years ago