[ 
https://issues.apache.org/jira/browse/CAMEL-14709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17059672#comment-17059672
 ] 

Zoran Regvart commented on CAMEL-14709:
---------------------------------------

The [{{$WORKSPACE}} environment 
variable|https://jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables]
 points to the directory that is used when running the build on Jenkins. We 
want to re-use the cached data obtained from previous builds and this is a way 
to do it across multiple builds. The [shell parameter 
expansion|https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html]
 allows us to substitute for current directory (obtained by executing 
[pwd|https://en.wikipedia.org/wiki/Pwd]) in cases when {{$WORKSPACE}} 
environment variable is not defined.

> Make sure that the website can be built in Windows
> --------------------------------------------------
>
>                 Key: CAMEL-14709
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14709
>             Project: Camel
>          Issue Type: Task
>          Components: website
>            Reporter: Zoran Regvart
>            Priority: Major
>              Labels: help-wanted
>
> Right now we [run the hugo 
> build|https://github.com/apache/camel-website/blob/21dbd4d74b5f0270a697e8de300eeff30dca14dd/package.json#L6]
>  from a npm/yarn script.
> This includes the {{--cacheDir}} parameter which specifies where Hugo puts 
> cached data, e.g. data fetched via {{getJSON}}.
> When we build the website on the build server we wish to take advantage of 
> previously cached data, and to do that we [set the {{HUGO_CACHE_DIR}} 
> environment 
> variable|https://github.com/apache/camel-website/blob/21dbd4d74b5f0270a697e8de300eeff30dca14dd/Jenkinsfile#L41].
> The shell interpolation used: {{${HUGO_CACHE_DIR:-$(pwd)/.hugo_data}}} makes 
> sure that if {{HUGO_CACHE_DIR}} is not defined {{.hugo_data}} in current 
> directory is used instead.
> This doesn't work on Windows as it relies on Unix shell variable 
> interpolation.
> We need a solution that has the same functionality, i.e. we can specify the 
> cache directory via {{HUGO_CACHE_DIR}} environment variable and if the 
> {{HUGO_CACHE_DIR}} variable is not set use {{.hugo_data}} in current 
> directory, but works on both Unix and Windows systems.
> I think there could be a way to use some cross platform npm packages to do 
> this intended to be used in scripts; or we could create a helper JavaScript 
> file for this and invoke hugo binary from it.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to