1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-15 04:57:56 +00:00

scripts/update-gh-pages: slightly cleaner log output

This commit is contained in:
Markus Lehtonen 2021-03-18 19:27:41 +02:00
parent ba51a92d63
commit fa5272eaeb

View file

@ -48,24 +48,24 @@ update_helm_repo_index() {
eval `echo $asset_meta | jq -r '{id, name, url, browser_download_url} | keys[] as $k | "local asset_\($k)=\(.[$k])"'` eval `echo $asset_meta | jq -r '{id, name, url, browser_download_url} | keys[] as $k | "local asset_\($k)=\(.[$k])"'`
if [[ "$asset_name" != node-feature-discovery-chart-*tgz ]]; then if [[ "$asset_name" != node-feature-discovery-chart-*tgz ]]; then
echo "Asset $asset_name does not look like a Helm chart archive, skipping..." echo " $asset_name does not look like a Helm chart archive, skipping..."
continue continue
fi fi
# Check if the asset has changed # Check if the asset has changed
asset_id_old=`cat "$asset_name".id 2> /dev/null || :` asset_id_old=`cat "$asset_name".id 2> /dev/null || :`
if [[ $asset_id_old == $asset_id ]]; then if [[ $asset_id_old == $asset_id ]]; then
echo "$asset_name (id=$asset_id) unchanged, skipping..." echo " $asset_name (id=$asset_id) unchanged, skipping..."
continue continue
fi fi
# Update helm repo index # Update helm repo index
local tmpdir="`mktemp -d`" local tmpdir="`mktemp -d`"
echo "Downloading $asset_name..." echo " downloading $asset_name..."
curl -sSfL -H "Accept:application/octet-stream" -o "$tmpdir/$asset_name" $asset_url curl -sSfL -H "Accept:application/octet-stream" -o "$tmpdir/$asset_name" $asset_url
echo "Updating helm index for $asset_name..." echo " updating helm index for $asset_name..."
local download_baseurl=`dirname $asset_browser_download_url` local download_baseurl=`dirname $asset_browser_download_url`
helm repo index "$tmpdir" --merge index.yaml --url $download_baseurl helm repo index "$tmpdir" --merge index.yaml --url $download_baseurl
cp "$tmpdir/index.yaml" . cp "$tmpdir/index.yaml" .
@ -182,7 +182,7 @@ else
fi fi
# Switch to work in the gh-pages worktree # Switch to work in the gh-pages worktree
pushd "$build_dir" pushd "$build_dir" > /dev/null
_stable=`(ls -d1 v*/ || :) | sort -n | tail -n1` _stable=`(ls -d1 v*/ || :) | sort -n | tail -n1`
[ -n "$_stable" ] && ln -sfT "$_stable" stable [ -n "$_stable" ] && ln -sfT "$_stable" stable
@ -197,9 +197,9 @@ EOF
# Update Helm repo # Update Helm repo
mkdir -p charts mkdir -p charts
pushd charts pushd charts > /dev/null
update_helm_repo_index update_helm_repo_index
popd popd > /dev/null
# Check if there were any changes in the repo # Check if there were any changes in the repo
if [ -z "`git status --short`" ]; then if [ -z "`git status --short`" ]; then
@ -214,7 +214,7 @@ echo "Committing changes..."
git add . git add .
git commit $amend -m "$commit_msg" git commit $amend -m "$commit_msg"
popd popd > /dev/null
echo "gh-pages branch successfully updated" echo "gh-pages branch successfully updated"