You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2023/04/27 16:57:08 UTC

[comdev-events-site] branch preview/sample updated: Skip Hugo install if present

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

sebb pushed a commit to branch preview/sample
in repository https://gitbox.apache.org/repos/asf/comdev-events-site.git


The following commit(s) were added to refs/heads/preview/sample by this push:
     new dcf0280  Skip Hugo install if present
dcf0280 is described below

commit dcf02802170cd4b393e15be0948ac1d317910622
Author: Sebb <se...@apache.org>
AuthorDate: Thu Apr 27 17:56:59 2023 +0100

    Skip Hugo install if present
---
 Jenkinsfile | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 8ae20b1..5b22733 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -36,7 +36,17 @@ pipeline {
                 script {
                     // Capture last commit hash for final commit message
                     env.LAST_SHA = sh(script:'git log -n 1 --pretty=format:\'%H\'', returnStdout: true).trim()
-
+                    // Get current Hugo version
+                    env.HUGO_VERSION_CURRENT = sh(script:'hugo version | cut -f 2 -d" "|cut -d- -f 1', returnStdout: true).trim()
+                }
+            }
+        }
+        stage("Install Hugo") {
+            when {
+              expression { env.HUGO_VERSION_CURRENT != ${HUGO_VERSION} }
+            }
+            steps {
+                script {
                     // Download Hugo
                     env.HUGO_DIR = sh(script:'mktemp -d', returnStdout: true).trim()
                     sh "mkdir -p ${env.HUGO_DIR}/bin"
@@ -47,6 +57,12 @@ pipeline {
                     // Unpack Hugo
                     sh "tar -C ${env.HUGO_DIR}/bin -xkf ${env.HUGO_DIR}/hugo.tar.gz"
 
+                }
+            }
+        }
+        stage("Install Pagefind") {
+            steps {
+                script {
                     // Download Pagefind
                     env.PAGEFIND_DIR = sh(script:'mktemp -d', returnStdout: true).trim()
                     sh "mkdir -p ${env.PAGEFIND_DIR}/bin"
@@ -57,6 +73,12 @@ pipeline {
                     // Unpack Pagefind
                     sh "tar -C ${env.PAGEFIND_DIR}/bin -xkf ${env.PAGEFIND_DIR}/pagefind.tar.gz"
 
+                }
+            }
+        }
+        stage("Setup directory") {
+            steps {
+                script {
                     // Setup directory structure for generated content
                     env.TMP_DIR = sh(script:'mktemp -d', returnStdout: true).trim()
                     env.OUT_DIR = "${env.TMP_DIR}/content"