[maven-surefire] branch diskspace updated (01afb60 -> 79f5854)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven-surefire] branch diskspace updated (01afb60 -> 79f5854)

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

tibordigana pushed a change to branch diskspace
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git.


 discard 01afb60  saved much more disk space on Jenkins build
     new 79f5854  saved much more disk space on Jenkins build

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (01afb60)
            \
             N -- N -- N   refs/heads/diskspace (79f5854)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Reply | Threaded
Open this post in threaded view
|

[maven-surefire] 01/01: saved much more disk space on Jenkins build

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

tibordigana pushed a commit to branch diskspace
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit 79f585445e4696906e6602eb90af8065d3ebb398
Author: Tibor17 <[hidden email]>
AuthorDate: Fri Jan 4 17:32:55 2019 +0100

    saved much more disk space on Jenkins build
---
 Jenkinsfile | 69 ++++++++++++++++++++++++++++---------------------------------
 1 file changed, 32 insertions(+), 37 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index d3dd073..e72aa96 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -21,10 +21,10 @@
 
 properties(
     [
-        buildDiscarder(logRotator(artifactDaysToKeepStr: env.BRANCH_NAME == 'master' ? '5' : '1',
-                                  artifactNumToKeepStr: '5',
+        buildDiscarder(logRotator(artifactDaysToKeepStr: env.BRANCH_NAME == 'master' ? '1' : '2',
+                                  artifactNumToKeepStr: '50',
                                   daysToKeepStr: env.BRANCH_NAME == 'master' ? '10' : '5',
-                                  numToKeepStr: '10')
+                                  numToKeepStr: env.BRANCH_NAME == 'master' ? '5' : '3')
         ),
         disableConcurrentBuilds()
     ]
@@ -32,7 +32,7 @@ properties(
 
 final def oses = ['linux':'ubuntu && !H24', 'windows':'Windows']
 final def mavens = env.BRANCH_NAME == 'master' ? ['3.5.x', '3.3.x', '3.2.x'] : ['3.5.x']
-final def jdks = [12, 11, 8, 7]
+final def jdks = env.BRANCH_NAME == 'master' ? [12, 11, 8, 7] : [11, 8, 7]
 
 final def options = ['-e', '-V', '-B', '-nsu', '-P', 'run-its']
 final def goals = ['clean', 'install', 'jacoco:report']
@@ -114,9 +114,7 @@ timeout(time: 12, unit: 'HOURS') {
         currentBuild.result = 'FAILURE'
         throw e
     } finally {
-        stage("notifications") {
-            jenkinsNotify()
-        }
+        jenkinsNotify()
     }
 }
 
@@ -152,7 +150,8 @@ def buildProcess(String stageKey, String jdkName, String jdkTestName, String mvn
                 ]) {
                     sh 'echo JAVA_HOME=$JAVA_HOME, JAVA_HOME_IT=$JAVA_HOME_IT, PATH=$PATH'
                     def script = cmd + ['\"-Djdk.home=$JAVA_HOME_IT\"']
-                    sh script.join(' ')
+                    def error = sh(returnStatus: true, script: script.join(' '))
+                    currentBuild.result = error == 0 ? 'SUCCESS' : 'FAILURE'
                 }
             } else {
                 withEnv(["JAVA_HOME=${tool(jdkName)}",
@@ -162,48 +161,44 @@ def buildProcess(String stageKey, String jdkName, String jdkTestName, String mvn
                 ]) {
                     bat 'echo JAVA_HOME=%JAVA_HOME%, JAVA_HOME_IT=%JAVA_HOME_IT%, PATH=%PATH%'
                     def script = cmd + ['\"-Djdk.home=%JAVA_HOME_IT%\"']
-                    bat script.join(' ')
+                    def error = bat(returnStatus: true, script: script.join(' '))
+                    currentBuild.result = error == 0 ? 'SUCCESS' : 'FAILURE'
                 }
             }
         }
     } finally {
-        stage("reporting ${stageKey}") {
-            if (makeReports) {
-                openTasks(ignoreCase: true, canComputeNew: false, defaultEncoding: 'UTF-8', pattern: sourcesPatternCsv(),
-                        high: tasksViolationHigh(), normal: tasksViolationNormal(), low: tasksViolationLow())
+        if (makeReports) {
+            openTasks(ignoreCase: true, canComputeNew: false, defaultEncoding: 'UTF-8', pattern: sourcesPatternCsv(),
+                    high: tasksViolationHigh(), normal: tasksViolationNormal(), low: tasksViolationLow())
 
-                jacoco(changeBuildStatus: false,
-                        execPattern: '**/*.exec',
-                        sourcePattern: sourcesPatternCsv(),
-                        classPattern: classPatternCsv())
+            jacoco(changeBuildStatus: false,
+                    execPattern: '**/*.exec',
+                    sourcePattern: sourcesPatternCsv(),
+                    classPattern: classPatternCsv())
 
-                junit(healthScaleFactor: 0.0,
-                        allowEmptyResults: true,
-                        keepLongStdio: true,
-                        testResults: testReportsPatternCsv())
+            junit(healthScaleFactor: 0.0,
+                    allowEmptyResults: true,
+                    keepLongStdio: true,
+                    testResults: testReportsPatternCsv())
 
-                if (currentBuild.result == 'UNSTABLE') {
-                    currentBuild.result = 'FAILURE'
-                }
+            if (currentBuild.result == 'UNSTABLE') {
+                currentBuild.result = 'FAILURE'
             }
+        }
 
-            if (currentBuild.result != null && currentBuild.result != 'SUCCESS') {
-                if (fileExists('maven-failsafe-plugin/target/it')) {
-                    zip(zipFile: "maven-failsafe-plugin--${stageKey}.zip", dir: 'maven-failsafe-plugin/target/it', archive: true)
-                }
-
-                if (fileExists('surefire-its/target')) {
-                    zip(zipFile: "surefire-its--${stageKey}.zip", dir: 'surefire-its/target', archive: true)
-                }
+        if (currentBuild.result != null && currentBuild.result != 'SUCCESS') {
+            if (fileExists('maven-failsafe-plugin/target/it')) {
+                zip(zipFile: "maven-failsafe-plugin--${stageKey}.zip", dir: 'maven-failsafe-plugin/target/it', archive: true)
+            }
 
-                archiveArtifacts(artifacts: "*--${stageKey}.zip", allowEmptyArchive: true, onlyIfSuccessful: false)
+            if (fileExists('surefire-its/target')) {
+                zip(zipFile: "surefire-its--${stageKey}.zip", dir: 'surefire-its/target', archive: true)
             }
-        }
 
-        stage("cleanup ${stageKey}") {
-            // clean up after ourselves to reduce disk space
-            cleanWs()
+            archiveArtifacts(artifacts: "*--${stageKey}.zip", allowEmptyArchive: true, onlyIfSuccessful: false)
         }
+        // clean up after ourselves to reduce disk space
+        cleanWs()
     }
 }