hugo: use Go toolchain to update module version

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-03-06 16:08:12 +01:00
parent a4609c201d
commit a719c2531f
1 changed files with 9 additions and 5 deletions

View File

@ -50,11 +50,15 @@ RUN htmltest
FROM build-base as update-modules
ARG MODULE
RUN if [ -n "$MODULE" ]; then \
hugo mod get ${MODULE}; \
else \
echo "no module set"; \
fi
RUN <<"EOT"
if [ -n "$MODULE" ]; then
go mod edit -dropdreplace ${MODULE/@*/}
hugo mod get ${MODULE}
go mod edit -replace ${MODULE/@*/}=${MODULE};
else \
echo "no module set"; \
fi
EOT
RUN hugo mod vendor
FROM scratch as vendor