You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2024/01/31 09:57:34 UTC

(maven-jenkins-lib) branch master updated: Remove separate stage for checkout

This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-jenkins-lib.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d60708  Remove separate stage for checkout
9d60708 is described below

commit 9d6070835830651329d4c8cb468fb551a56af08d
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Thu Jan 11 23:59:14 2024 +0100

    Remove separate stage for checkout
    
    We can reduce:
    - additional check on GitHub PR
    - additional box on standard jenkins view
---
 vars/asfMavenTlpPlgnBuild.groovy | 22 +---------------------
 vars/asfMavenTlpStdBuild.groovy  | 23 ++---------------------
 2 files changed, 3 insertions(+), 42 deletions(-)

diff --git a/vars/asfMavenTlpPlgnBuild.groovy b/vars/asfMavenTlpPlgnBuild.groovy
index f0ca2b7..83e0b51 100644
--- a/vars/asfMavenTlpPlgnBuild.groovy
+++ b/vars/asfMavenTlpPlgnBuild.groovy
@@ -167,27 +167,6 @@ def doCreateTask( os, jdk, maven, tasks, first, plan, taskContext )
       }
       ws( dir : "$wsDir" )
       {
-        stage("Checkout ${stageId}") {
-          echo "NODE_NAME = ${env.NODE_NAME}"
-          try {
-            dir(stageDir) {
-              checkout scm
-            }
-          } catch (Throwable e) {
-            // First step to keep the workspace clean and safe disk space
-            cleanWs()
-
-            if (!taskContext.failFast) {
-              throw e
-            } else if (taskContext.failingFast == null) {
-              taskContext.failingFast = stageId
-              echo "[FAIL FAST] This is the first failure and likely root cause"
-              throw e
-            } else {
-              echo "[FAIL FAST] ${taskContext.failingFast} had first failure, ignoring ${e.message}"
-            }
-          } 
-        }
         stage("Build ${stageId}") {
           if (taskContext.failingFast != null) {
             cleanWs()
@@ -202,6 +181,7 @@ def doCreateTask( os, jdk, maven, tasks, first, plan, taskContext )
                "PATH+MAVEN=${ tool "$jdkName" }/bin:${tool "$mvnName"}/bin",
                "MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
              dir (stageDir) {
+               checkout scm
                if (isUnix()) {
                  sh 'df -hT'
                  sh cmd.join(' ')
diff --git a/vars/asfMavenTlpStdBuild.groovy b/vars/asfMavenTlpStdBuild.groovy
index 4071f7a..357f2c4 100644
--- a/vars/asfMavenTlpStdBuild.groovy
+++ b/vars/asfMavenTlpStdBuild.groovy
@@ -86,26 +86,6 @@ def call(Map params = [:]) {
                 wsDir = 'F:\\short\\' + "$BUILD_TAG".replaceAll(/(.+)-maven-box-maven-(.+)/) { "m-${it[2]}" }
               }
               ws( dir : "$wsDir" ) {
-                stage("Checkout ${stageId}") {
-                  echo "NODE_NAME = ${env.NODE_NAME}"
-                  try {
-                    dir('m') {
-                      checkout scm
-                    }
-                  } catch (Throwable e) {
-                    // First step to keep the workspace clean and safe disk space
-                    cleanWs()
-                    if (!failFast) {
-                      throw e
-                    } else if (failingFast == null) {
-                      failingFast = stageId
-                      echo "[FAIL FAST] This is the first failure and likely root cause"
-                      throw e
-                    } else {
-                      echo "[FAIL FAST] ${failingFast} had first failure, ignoring ${e.message}"
-                    }
-                  }
-                }
                 stage("Build ${stageId}") {
                   if (failingFast != null) {
                     cleanWs()
@@ -122,7 +102,8 @@ def call(Map params = [:]) {
     // DISABLED DUE TO INFRA-17514 invokerPublisher(),
                                 pipelineGraphPublisher(disabled: disablePublishers)
                               ], publisherStrategy: 'EXPLICIT') {
-                    dir ('m') {
+                      dir ('m') {
+                        checkout scm
                         if (isUnix()) {
                           sh cmd.join(' ')
                         } else {