mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-20 11:09:30 +00:00
calculate manifest hash-tag using git ls-tree
Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
@@ -17,8 +17,13 @@ IMAGE=$2
|
||||
IMG_X86_64=$(head -1 versions.x86_64 | sed 's,[#| ]*,,')
|
||||
IMG_ARM64=$(head -1 versions.aarch64 | sed 's,[#| ]*,,')
|
||||
IMG_s390x=$(head -1 versions.s390x | sed 's,[#| ]*,,')
|
||||
# Extract the TAG from the x86_64 name and build the manifest target name
|
||||
TAG=$(echo "$IMG_X86_64" | sed 's,\-.*$,,' | cut -d':' -f2)
|
||||
# Extract the TAG from the tree hash - just like how "linuxkit pkg show-tag" does it - name and build the manifest target name
|
||||
TAG=$(git ls-tree --full-tree HEAD -- $(pwd) | awk '{print $3}')
|
||||
DIRTY=$(git diff-index HEAD -- $(pwd))
|
||||
if [ -n "$DIRTY"]; then
|
||||
echo "will not push out manifest when git tree is dirty" >&2
|
||||
exit 1
|
||||
fi
|
||||
TARGET="$ORG/$IMAGE:$TAG"
|
||||
|
||||
YAML=$(mktemp)
|
||||
@@ -77,4 +82,4 @@ fi
|
||||
# Push manifest list
|
||||
OUT=$(manifest-tool $MT_ARGS push from-spec --ignore-missing "$YAML")
|
||||
rm "$YAML"
|
||||
echo "$OUT"
|
||||
echo "$OUT"
|
||||
|
Reference in New Issue
Block a user