Skip to content

Commit

Permalink
Merge pull request #38 from kusha/custom-hugo-dir-onbuild
Browse files Browse the repository at this point in the history
Add customization of Hugo root for onbuild
  • Loading branch information
klakegg authored Oct 31, 2020
2 parents 20e44ee + 9442faa commit e21db0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ Available arguments for `docker build`:
* HUGO_CMD - Commands passed to Hugo during build. Default *empty*
* HUGO_DESTINATION_ARG - Location of output folder. Default: `/target`
* HUGO_ENV_ARG - Selecting environment ("DEV"/"production"). Default: `DEV`
* HUGO_DIR - Selecting Hugo root directory. Default: `/src`


## Using CI image (0.77.0 or newer)
Expand Down
2 changes: 2 additions & 0 deletions src/docker/_imports/onbuild.df
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ FROM main AS onbuild
ONBUILD ARG HUGO_CMD
ONBUILD ARG HUGO_DESTINATION_ARG
ONBUILD ARG HUGO_ENV_ARG
ONBUILD ARG HUGO_DIR

ONBUILD ENV HUGO_DESTINATION="${HUGO_DESTINATION_ARG:-/target}" \
HUGO_ENV="${HUGO_ENV_ARG:-DEV}"

ONBUILD COPY . /src
ONBUILD WORKDIR ${HUGO_DIR:-/src}
ONBUILD RUN hugo ${HUGO_CMD}

0 comments on commit e21db0e

Please sign in to comment.