Skip to content

Commit

Permalink
Collect all images into one single txt file
Browse files Browse the repository at this point in the history
Signed-off-by: Jian Wang <w13915984028@gmail.com>
  • Loading branch information
w13915984028 authored and guangbochen committed Aug 21, 2023
1 parent 12e6898 commit a94331a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/package-harvester-os
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,21 @@ spec:
EOF
fi

# Collect image lists to a tarball "image-lists.tar.gz"
# Collect image lists
OUTPUT_DIR="$TOP_DIR/dist/artifacts/image-lists"
mkdir -p $OUTPUT_DIR
find $IMAGES_LISTS_DIR -name "*.txt" -exec cp {} $OUTPUT_DIR \;
find $RANCHERD_IMAGES_DIR -name "*.txt" -exec cp {} $OUTPUT_DIR \;

# Write all images into one file for user convenience
IMAGE_ALL=$TOP_DIR/dist/artifacts/harvester-images-list.txt
rm -f ${IMAGE_ALL}
echo "# All images in the Harvester ISO built @ " $(date) $'\n' > ${IMAGE_ALL}
for filename in $OUTPUT_DIR/*.txt; do
echo "# In" $(basename ${filename}) >> ${IMAGE_ALL}
cat $filename >> ${IMAGE_ALL}
echo "" >> ${IMAGE_ALL}
done

# Write image lists to a tarball "image-lists.tar.gz"
tar zcvf $TOP_DIR/dist/artifacts/image-lists.tar.gz -C $TOP_DIR/dist/artifacts image-lists && rm -rf $OUTPUT_DIR

0 comments on commit a94331a

Please sign in to comment.