Skip to content

Commit

Permalink
Remove diff check before pushing the bundle for staging and prod rele…
Browse files Browse the repository at this point in the history
…ase (#1146)
  • Loading branch information
jhaanvi5 authored Jul 17, 2024
1 parent 1ebe4eb commit 4ea58d2
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions generatebundlefile/hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,7 @@ function push () {
;;
esac

if "$ORAS_BIN" pull "${REPO}:${latest_tag}" -o ${version}; then
removeBundleMetadata ${version}/bundle.yaml
else
mkdir -p ${version} && touch ${version}/bundle.yaml.stripped
fi

if (git diff --no-index --quiet -- ${version}/bundle.yaml.stripped bundle.yaml.stripped) then
echo "bundle contents are identical skipping bundle push for ${version}"
else
"$ORAS_BIN" push "${REPO}:${versioned_tag}" bundle.yaml
"$ORAS_BIN" push "${REPO}:${latest_tag}" bundle.yaml
fi
}
"$ORAS_BIN" push "${REPO}:${versioned_tag}" bundle.yaml
"$ORAS_BIN" push "${REPO}:${latest_tag}" bundle.yaml

function removeBundleMetadata () {
local bundle=${1?:no bundle specified}
yq 'del(.metadata.name)' ${bundle} > ${bundle}.strippedname
yq 'del(.metadata.annotations)' ${bundle}.strippedname > ${bundle}.stripped
}

0 comments on commit 4ea58d2

Please sign in to comment.