Verified Commit e8d7daa7 authored by hashworks's avatar hashworks
Browse files

Avoid curl call on local builds

parent 3c694ab7
......@@ -225,7 +225,7 @@ release:
sed "/TEMPLATE_ROOTFS_FILE/d" Dockerfile.template > output/Dockerfile.${group}
package_url=$(./ci/get-public-download-for-generic-package.sh ${group}-${BUILD_VERSION}.tar.xz)
sed -i "s|TEMPLATE_ROOTFS_RELEASE_URL|https://gitlab.archlinux.org/archlinux/archlinux-docker/-/releases/v${BUILD_VERSION}|" output/Dockerfile.${group}
sed -i "s|TEMPLATE_ROOTFS_URL|${package_url}|" output/Dockerfile.${group}
sed -i "s|TEMPLATE_ROOTFS_DOWNLOAD|ROOTFS=\"\$(curl -sOJL -w \"%{filename_effective}\" \"${package_url}\")\"|" output/Dockerfile.${group}
sed -i "s|TEMPLATE_ROOTFS_HASH|$(cat output/${group}.tar.xz.SHA256)|" output/Dockerfile.${group}
done
- >
......
......@@ -13,7 +13,7 @@ COPY TEMPLATE_ROOTFS_FILE /
RUN apk add --no-cache curl bash
SHELL ["/bin/bash", "-c"]
# TEMPLATE_ROOTFS_RELEASE_URL
RUN ROOTFS="$(curl -sOJL -w "%{filename_effective}" TEMPLATE_ROOTFS_URL)" && \
RUN TEMPLATE_ROOTFS_DOWNLOAD && \
sha256sum -c <<< "TEMPLATE_ROOTFS_HASH" && \
mkdir /rootfs && \
tar -C /rootfs --extract --file "${ROOTFS}"
......
......@@ -39,7 +39,7 @@ endef
define dockerfile
sed -e "s|TEMPLATE_ROOTFS_FILE|$(1).tar.xz|" \
-e "s|TEMPLATE_ROOTFS_RELEASE_URL|Local build|" \
-e "s|TEMPLATE_ROOTFS_URL|file:///$(1).tar.xz|" \
-e "s|TEMPLATE_ROOTFS_DOWNLOAD|ROOTFS=\"$(1).tar.xz\"|" \
-e "s|TEMPLATE_ROOTFS_HASH|$$(cat $(OUTPUTDIR)/$(1).tar.xz.SHA256)|" \
Dockerfile.template > $(OUTPUTDIR)/Dockerfile.$(1)
endef
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment