local image_type
local compression_type
+ local compression_level=1
+
+ if [[ ${IMAGE_RELEASE} -eq ${TRUE} ]]; then
+ compression_level=9
+ fi
# Do these steps for every image format we like to publish
for image_type in ${IMAGE_TYPES_PUBLISH}; do
convert_image "${image_type}" "${image_base_file}" "${image_name_final}"
# compress image.
- compress_image "${compression_type}" "${image_name_final}.${image_type}" "1"
+ compress_image "${compression_type}" "${image_name_final}.${image_type}" ${compression_level}
# Move images to this path
mv -f "${image_name_final}.${image_type}.${compression_type}" ${path}
fi
}
+parse_cmdline() {
+ while [ $# -gt 0 ]; do
+ case "${1}" in
+ "--release")
+ IMAGE_RELEASE=${TRUE}
+ ;;
+
+ *)
+ error "Invalid argument: ${1}"
+ return ${EXIT_CONF_ERROR}
+ ;;
+ esac
+ shift
+ done
+}
+
#
# General settings
#
# Scripts starts here
#
+#Parse cmdline
+parse_cmdline $@
+
# Check that pakfire is working
check_for_pakfire