Add output image format tgz support
We now support tgz (tar.gz) as an output format. Change-Id: Iadec92f2f96c3f904f28bd49f87ffc7d48ef7bd7 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
6d82543682
commit
da41ee6012
@ -102,7 +102,7 @@ function show_options () {
|
||||
echo "Options:"
|
||||
echo " -a i386|amd64|armhf -- set the architecture of the image(default amd64)"
|
||||
echo " -o imagename -- set the imagename of the output image file(default image)"
|
||||
echo " -t qcow2,tar,vhd,docker,aci,raw -- set the image types of the output image files (default qcow2)"
|
||||
echo " -t qcow2,tar,tgz,vhd,docker,aci,raw -- set the image types of the output image files (default qcow2)"
|
||||
echo " File types should be comma separated. VHD outputting requires the vhd-util"
|
||||
echo " executable be in your PATH. ACI outputting requires the ACI_MANIFEST "
|
||||
echo " environment variable be a path to a manifest file."
|
||||
@ -258,6 +258,10 @@ for X in ${!IMAGE_TYPES[@]}; do
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
tgz)
|
||||
# Force tar to be created.
|
||||
IMAGE_TYPES+=('tar')
|
||||
;;
|
||||
vhd)
|
||||
if [ -z "$(which vhd-util)" ]; then
|
||||
echo "vhd output format specified but no vhd-util executable found."
|
||||
|
@ -51,6 +51,7 @@ formats are:
|
||||
|
||||
* qcow2
|
||||
* tar
|
||||
* tgz
|
||||
* vhd
|
||||
* docker
|
||||
* raw
|
||||
|
@ -122,6 +122,9 @@ function compress_and_save_image () {
|
||||
fi
|
||||
if [ "$IMAGE_TYPE" = "raw" ]; then
|
||||
mv $TMP_IMAGE_PATH $1-new
|
||||
elif [ "$IMAGE_TYPE" == "tgz" ]; then
|
||||
gzip -9 < $IMAGE_NAME.tar > $1-new
|
||||
rm $IMAGE_NAME.tar
|
||||
elif [ "$IMAGE_TYPE" == "vhd" ]; then
|
||||
cp $TMP_IMAGE_PATH $1-intermediate
|
||||
vhd-util convert -s 0 -t 1 -i $1-intermediate -o $1-intermediate
|
||||
|
@ -59,7 +59,7 @@ function build_test_image() {
|
||||
fi
|
||||
}
|
||||
|
||||
test_formats="tar raw qcow2 docker aci"
|
||||
test_formats="tar tgz raw qcow2 docker aci"
|
||||
for binary in qemu-img docker ; do
|
||||
if [ -z "$(which $binary)" ]; then
|
||||
echo "Warning: No $binary binary found, cowardly refusing to run tests."
|
||||
|
Loading…
Reference in New Issue
Block a user