]> git.ipfire.org Git - people/jschlag/ipfire-3.x-image.git/commitdiff
Compress images only for releasCompress images only for release
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Sat, 22 Jun 2019 14:11:06 +0000 (15:11 +0100)
committerJonatan Schlag <jonatan.schlag@ipfire.org>
Sat, 22 Jun 2019 14:11:06 +0000 (15:11 +0100)
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
generate_image.sh

index 964a0bed4a2f909f4b8a12fdbf31a700c08012af..9309f7afc39c910fef791546a5101d5fce4f2f9d 100755 (executable)
@@ -170,32 +170,36 @@ publish() {
        local image_base_file=${2}
 
        local image_name_final="$(generate_image_filename "${DISTRO}" "${VERSION}" "${ARCH}")"
-
        local image_type
-       local compression_type
-       local compression_level=1
-
-       if [[ ${IMAGE_RELEASE} -eq ${TRUE} ]]; then
-               compression_level=1
-       fi
 
        # Do these steps for every image format we like to publish
        for image_type in ${IMAGE_TYPES_PUBLISH}; do
-               # Get compressioon type
-               compression_type="$(get_compression_type ${image_type})"
                # Convert images to the type specified in IMAGE_TYPES_PUBLISH
                convert_image "${image_type}" "${image_base_file}" "${image_name_final}"
 
                # compress image.
-               compress_image "${compression_type}" "${image_name_final}.${image_type}" ${compression_level}
+               if [[ ${IMAGE_RELEASE} -eq ${TRUE} ]]; then
+                       local compression_type
+                       local compression_level
+
 
-               # Move images to this path
-               mv -f "${image_name_final}.${image_type}.${compression_type}" ${path}
+                       # Get compressioon type
+                       compression_type="$(get_compression_type ${image_type})"
 
-               # point the latest links to these images
-               ln -s -f "${path}/${image_name_final}.${image_type}.${compression_type}" \
-                       "${path}/$(generate_image_filename "${DISTRO}" "latest" "${ARCH}").${image_type}.${compression_type}"
+                       compression_level=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}
+
+                       # point the latest links to these images
+                       ln -s -f "${path}/${image_name_final}.${image_type}.${compression_type}" \
+                               "${path}/$(generate_image_filename "${DISTRO}" "latest" "${ARCH}").${image_type}.${compression_type}"
+               else
+
+                       # Move images to this path
+                       mv -f "${image_name_final}.${image_type}" ${path}
+               fi
        done
 
 }