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

tibordigana 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 bb8bb6b  added archives
bb8bb6b is described below

commit bb8bb6b6f46eedcd816928f26edff4ecd133d3e9
Author: tibordigana <tibordig...@apache.org>
AuthorDate: Sun Jul 28 01:12:25 2019 +0200

    added archives
---
 vars/asfMavenTlpPlgnBuild.groovy | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/vars/asfMavenTlpPlgnBuild.groovy b/vars/asfMavenTlpPlgnBuild.groovy
index eff183f..59d0bc1 100644
--- a/vars/asfMavenTlpPlgnBuild.groovy
+++ b/vars/asfMavenTlpPlgnBuild.groovy
@@ -46,6 +46,7 @@ def call(Map params = [:]) {
     
     taskContext['failFast'] = failFast;
     taskContext['tmpWs'] = tmpWs;
+    taskContext['archives'] = params.archives
 
     Map tasks = [failFast: failFast]
     boolean first = true
@@ -205,6 +206,7 @@ def doCreateTask( os, jdk, maven, tasks, first, plan, 
taskContext )
               }
             }
           } catch (Throwable e) {
+            archiveDirs(taskContext.archives)
             // First step to keep the workspace clean and safe disk space
             cleanWs()
             if (!taskContext.failFast) {
@@ -224,3 +226,11 @@ def doCreateTask( os, jdk, maven, tasks, first, plan, 
taskContext )
     }
   }
 }
+
+def archiveDirs(archives) {
+  if (archives != null) {
+    archives.each { archiveFileName, pathToContent ->
+         zip(zipFile: "${archiveFileName}.zip", dir: pathToContent, archive: 
true)
+    }
+  }
+}

Reply via email to