You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by gk...@apache.org on 2021/12/08 14:06:29 UTC

[turbine-fulcrum-build] branch master updated: fix Jenkinsfile: remove if condition, add boolean param replace unsupported git branch --show-current, tested in jenkins with Single Pipeline, added scm (bit not yet any release for this helper repo

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

gk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/turbine-fulcrum-build.git


The following commit(s) were added to refs/heads/master by this push:
     new 1be16d6  fix Jenkinsfile: remove if condition, add boolean param replace unsupported git branch --show-current, tested in jenkins with Single Pipeline, added scm (bit not yet any release for this helper repo
1be16d6 is described below

commit 1be16d66759c4096d5d0b666a1791f577bb8a671
Author: Georg Kallidis <gk...@cedis.fu-berlin.de>
AuthorDate: Wed Dec 8 15:05:54 2021 +0100

    fix Jenkinsfile: remove if condition, add boolean param replace unsupported git branch --show-current, tested in jenkins with Single Pipeline, added scm (bit not yet any release for this helper repo
---
 Jenkinsfile | 30 +++++++++++++++++-------------
 pom.xml     |  7 +++++++
 2 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index b68873e..fa266b7 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,7 +45,9 @@ pipeline
     {
         agent
             {
-                label AGENT_LABEL
+                node {
+                    label AGENT_LABEL 
+                }
             }
         parameters
             {
@@ -55,6 +57,7 @@ pipeline
                 choice(name: 'FULCRUM_COMPONENT', choices: ['','cache', 'crypto', 'factory', 'intake', 'json', 'localization', 'parser', 'pool', 'quartz', 'security', 'site', 'testcontainer', 'upload', 'yaafi', 'yaafi-crypto'], description: 'Select fulcrum component')
                 // default master
                 choice(name: 'SUB_MODULE_HEAD', choices: ['master', 'main','trunk'], description: 'The master/main/trunk branch of the Fulcrum component')
+                booleanParam(name: 'TEST_MODE', defaultValue: true, description: 'Run as Test Build or Deploy site for Component ')
             }
         tools
             {
@@ -77,15 +80,6 @@ pipeline
                 MAVEN_CLI_OPTS = "-B -V -U -e -fae -ntp -Dsurefire.useFile=false"
                 MAVEN_GOALS = "${params.MULTI_MODULE == 'site' ? 'clean site' : 'clean site site:stage'}"
             }
-        if ( $FULCRUM_COMPONENT == '')
-        {
-            echo "No FULCRUM_COMPONENT provided: $FULCRUM_COMPONENT"
-            // no mail
-            currentBuild.result = 'SUCCESS'
-            return
-        } else {
-            echo "Building site for FULCRUM_COMPONENT: $FULCRUM_COMPONENT"
-        }
         stages
             {
             stage('Prepare')
@@ -103,9 +97,11 @@ pipeline
                                             sh "git branch"
                                             echo "$FULCRUM_COMPONENT: Checking out ${params.SUB_MODULE_HEAD}"
                                             sh "git checkout ${params.SUB_MODULE_HEAD}"
-                                            env.CURRENT_BRANCH = sh(script: 'git branch --show-current', returnStdout: true).trim()
+                                            env.CURRENT_BRANCH = sh(script: "git status --branch --porcelain | grep '##' | cut -c 4-", returnStdout: true).trim()
+                                            echo "CURRENT_BRANCH: ${env.CURRENT_BRANCH}"
                                             // Capture last commit hash for final commit message
                                             env.LAST_SHA = sh(script: 'git log -n 1 --pretty=format:%H', returnStdout: true).trim()
+                                            echo "LAST_SHA: ${env.LAST_SHA}"
                                         }
                                 }
                         }
@@ -149,12 +145,20 @@ pipeline
                 {
                     when
                         {
-                        anyOf
+                        allOf {
+                            not {
+                                expression 
+                                    { 
+                                        params.TEST_MODE 
+                                    }
+                            }
+                           anyOf
                             {
                                 expression
                                     {
-                                        env.CURRENT_BRANCH ==~ /master|trunk|main/
+                                        env.CURRENT_BRANCH ==~ /(?i)^(master|trunk|main).*?/
                                     }
+                            }
                         }
                     }
                     steps
diff --git a/pom.xml b/pom.xml
index d4c5db4..6135ff9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,6 +69,13 @@
 
   </modules>
   
+    <scm>
+        <connection>scm:git:https://gitbox.apache.org/repos/asf/turbine-fulcrum-build.git</connection>
+        <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/turbine-fulcrum-build.git</developerConnection>    
+        <url>https://github.com/apache/turbine-fulcrum-build/tree/${project.scm.tag}</url>
+        <tag>master</tag>
+    </scm>
+  
   <build>
      <pluginManagement>
         <plugins>