Jenkinsfile: skip default checkout and checkout manually when needed

Project: http://git-wip-us.apache.org/repos/asf/logging-log4net/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4net/commit/4e968bdd
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4net/tree/4e968bdd
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4net/diff/4e968bdd

Branch: refs/heads/develop
Commit: 4e968bdd79eb2330142231df798bf0315e9adf9b
Parents: 48926d6
Author: Dominik Psenner <[email protected]>
Authored: Mon Jul 3 14:33:12 2017 +0200
Committer: Dominik Psenner <[email protected]>
Committed: Mon Jul 3 14:33:12 2017 +0200

----------------------------------------------------------------------
 Jenkinsfile | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/4e968bdd/Jenkinsfile
----------------------------------------------------------------------
diff --git a/Jenkinsfile b/Jenkinsfile
index 6b3dfce..4cc242f 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,23 +20,20 @@
 pipeline {
        options {
                timeout(time: 1, unit: 'HOURS')
+               buildDiscarder(logRotator(numToKeepStr: '1'))
+               skipDefaultCheckout()
        }
        agent {
                label 'ubuntu'
-               skipDefaultCheckout()
        }
        stages {
-               stage('checkout') {
-                       steps {
-                               checkout scm
-                       }
-               }
                stage('build net-4.0') {
                        agent { label 'Windows' }
                        environment {
                                NANT_BIN = getPathToNAntOnWindows()
                        }
                        steps {
+                               checkout scm
                                bat "${NANT_BIN} -buildfile:log4net.build 
compile-net-4.0"
                                stash includes: 'bin/**/*.*', name: 
'net-4.0-assemblies'
                        }
@@ -47,6 +44,7 @@ pipeline {
                                NANT_BIN = getPathToNAntOnWindows()
                        }
                        steps {
+                               checkout scm
                                bat "${NANT_BIN} -buildfile:log4net.build 
compile-net-4.0-cp"
                                stash includes: 'bin/**/*.*', name: 
'net-4.0-cp-assemblies'
                        }
@@ -57,6 +55,7 @@ pipeline {
                                NANT_BIN = getPathToNAntOnWindows()
                        }
                        steps {
+                               checkout scm
                                bat "${NANT_BIN} -buildfile:log4net.build 
compile-net-4.5"
                                stash includes: 'bin/**/*.*', name: 
'net-4.5-assemblies'
                        }
@@ -69,6 +68,7 @@ pipeline {
                                }
                        }
                        steps {
+                               checkout scm
                                sh "nant -t:mono-2.0 -buildfile:log4net.build 
compile-mono-2.0"
                                stash includes: 'bin/**/*.*', name: 
'mono-2.0-assemblies'
                        }
@@ -81,6 +81,7 @@ pipeline {
                                }
                        }
                        steps {
+                               checkout scm
                                sh "nant -t:mono-3.5 -buildfile:log4net.build 
compile-mono-3.5"
                                stash includes: 'bin/**/*.*', name: 
'mono-3.5-assemblies'
                        }
@@ -93,6 +94,7 @@ pipeline {
                                }
                        }
                        steps {
+                               checkout scm
                                sh "nant -t:mono-4.0 -buildfile:log4net.build 
compile-mono-4.0"
                                stash includes: 'bin/**/*.*', name: 
'mono-4.0-assemblies'
                        }
@@ -107,6 +109,7 @@ pipeline {
                                NANT_BIN = getPathToNAntOnWindows()
                        }
                        steps {
+                               checkout scm
                                bat "${NANT_BIN} -buildfile:log4net.build 
generate-site"
                                stash includes: 'target/site-deploy/**/*.*', 
name: 'site'
                        }
@@ -118,6 +121,7 @@ pipeline {
                                NANT_BIN = getPathToNAntOnWindows()
                        }
                        steps {
+                               checkout scm
                                bat "${NANT_BIN} -buildfile:tests\\nant.build"
                                // TODO: stash test results
                        }

Reply via email to