You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by kw...@apache.org on 2024/08/03 08:24:22 UTC

(jackrabbit-filevault-jenkins-lib) branch feature/support-secrets updated (73d50ad -> f2f0687)

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

kwin pushed a change to branch feature/support-secrets
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault-jenkins-lib.git


 discard 73d50ad  Support simple secrets for Maven build
     new f2f0687  Support simple secrets for Maven 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   (73d50ad)
            \
             N -- N -- N   refs/heads/feature/support-secrets (f2f0687)

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:
 src/org/apache/jackrabbit/vault/PipelineSupport.groovy | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)


(jackrabbit-filevault-jenkins-lib) 01/01: Support simple secrets for Maven build

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/support-secrets
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault-jenkins-lib.git

commit f2f0687606e7b1bf476fbedbc7f139e8012b89d5
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Aug 2 21:08:37 2024 +0200

    Support simple secrets for Maven build
---
 src/org/apache/jackrabbit/vault/PipelineSupport.groovy | 12 ++++++++++++
 vars/vaultStageBuild.groovy                            |  4 +++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/org/apache/jackrabbit/vault/PipelineSupport.groovy b/src/org/apache/jackrabbit/vault/PipelineSupport.groovy
index 7cef9b3..07f10d4 100644
--- a/src/org/apache/jackrabbit/vault/PipelineSupport.groovy
+++ b/src/org/apache/jackrabbit/vault/PipelineSupport.groovy
@@ -18,6 +18,8 @@
  */
 package org.apache.jackrabbit.vault
 
+import org.jenkinsci.plugins.credentialsbinding.MultiBinding
+
 /**
  * Singleton class encapsulating information about main build environment and some helper methods.
  */
@@ -57,6 +59,16 @@ class PipelineSupport implements Serializable {
         executeMaven(pipeline, jdkVersion, mainMavenVersion, mavenArguments, '', enablePublishers)
     }
 
+    static def withSimpleCredentials(pipeline, Map<String, String> credentialIdToEnvironmentVariable, Closure closure) {
+        if (credentialIdToEnvironmentVariable == null) {
+            closure.call()
+        } else {
+            List<MultiBinding> bindings = credentialIdToEnvironmentVariable.collect{ e -> pipeline.string(credentialsId: e.key, variable: e.value) }
+            pipeline.echo("Bindings ${bindings}")
+            //pipeline.withCredentials(bindings, closure)
+        }
+    }
+
     static def executeMaven(pipeline, Integer jdkVersion, String mavenVersion, String mavenArguments, String mavenOpts = '', boolean enablePublishers) {
         pipeline.withMaven(
             maven: AsfCloudbeesJenkinsEnvironment.getMavenLabel(!pipeline.isUnix(), mavenVersion),
diff --git a/vars/vaultStageBuild.groovy b/vars/vaultStageBuild.groovy
index 2ab3290..a8d87e2 100644
--- a/vars/vaultStageBuild.groovy
+++ b/vars/vaultStageBuild.groovy
@@ -47,7 +47,9 @@ def call(List<String> additionalNodeLabels, List<Integer> additionalJdkVersions,
                                 } else {
                                     mavenArguments = additionalBuildArguments
                                 }
-                                PipelineSupport.executeMaven(this, jdkVersion, mavenVersion, mavenArguments, false)
+                                PipelineSupport.withSimpleCredentials(options.simpleSecretMap) {
+                                    PipelineSupport.executeMaven(this, jdkVersion, mavenVersion, mavenArguments, false)
+                                }
                                 if (isMainBuild) {
                                     if (hasSeparateItExecution) {
                                         // stash the integration test classes and the build artifact for later execution