You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@community.apache.org by "sebbASF (via GitHub)" <gi...@apache.org> on 2023/04/01 11:03:48 UTC

[GitHub] [comdev-site] sebbASF commented on a diff in pull request #100: Use pinned version of Hugo

sebbASF commented on code in PR #100:
URL: https://github.com/apache/comdev-site/pull/100#discussion_r1155094358


##########
Jenkinsfile:
##########
@@ -56,10 +68,13 @@ pipeline {
         stage('Build') {
             steps {
                 script {
-                    sh 'for i in $(which -a hugo) ; do echo $i; $i version; done'
-                    sh 'hugo version'
-                    sh "hugo --destination ${env.OUT_DIR}"
-                    sh "${env.PAGEFIND_DIR}/bin/pagefind --source ${env.OUT_DIR}"
+                    withEnv(["PATH+HUGO=${env.HUGO_DIR}/bin", "PATH+PAGEFIND=${env.PAGEFIND_DIR}/bin"]) {

Review Comment:
   The behaviour is similar, but not identical in all cases.
   
   If for some reason the hugo executable is not present at the first item on the path, then the withEnv version will fall back to checking the rest of the path. That would not be immediately obvious unless the build failed.
   
   This could happen if a different name was used in the tar, or the file was not executable for some reason.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@community.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@community.apache.org
For additional commands, e-mail: dev-help@community.apache.org