vscode-hugo/tools/chores/publish

20 lines
634 B
Text
Raw Normal View History

2024-08-17 00:35:18 +00:00
#!/bin/sh
script="$( readlink -f "${0}" )"
script_dir="$( dirname "${script}" )"
repo_dir="$( readlink -f "${script_dir}/../.." )"
# get hugo feature version from devcontainer.json
dc_json_file="${repo_dir}/.devcontainer.json"
HUGO_VERSION=$( grep -A3 'features/hugo' "${dc_json_file}" | grep 'version' | sed -r 's/^.*"([^"]+)",?\s*$/\1/' )
# TODO add --push to publish to registry
# TODO change --tag value
docker buildx build \
--pull \
--file "${script_dir}/.publish/Dockerfile" \
--build-arg "HUGO_VERSION=${HUGO_VERSION}" \
--tag "localhost/hugo-site:latest" \
--platform "linux/amd64" \
"${repo_dir}"