From 99ea7cc8876dad9583293a162cbbf14624dbc9d6 Mon Sep 17 00:00:00 2001 From: Alexsander Silva de Souza Date: Tue, 28 Nov 2023 11:34:54 -0300 Subject: [PATCH] get mirrors from the env make it easier to integrate with the build pipeline --- centos7/Makefile | 6 +++--- centos7/http/centos7.ks.in | 6 +++--- centos8/Makefile | 6 +++--- centos8/http/centos8.ks.in | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/centos7/Makefile b/centos7/Makefile index 0449e1a2..6f2bf5a2 100644 --- a/centos7/Makefile +++ b/centos7/Makefile @@ -4,8 +4,8 @@ include ../scripts/check.mk PACKER ?= packer PACKER_LOG ?= 0 - -export PACKER_LOG KS_PROXY +KS_MIRROR ?= http://mirrorlist.centos.org +export PACKER_LOG KS_PROXY KS_MIRROR .PHONY: all clean check-deps @@ -17,7 +17,7 @@ centos7.tar.gz: clean check-deps http/centos7.ks ${PACKER} init centos7.pkr.hcl && ${PACKER} build centos7.pkr.hcl http/centos7.ks: http/centos7.ks.in - envsubst '$${KS_PROXY}' < $< | tee $@ + envsubst '$${KS_PROXY} $${KS_MIRROR}' < $< | tee $@ clean: ${RM} -rf output-centos7 centos7.tar.gz http/centos7.ks diff --git a/centos7/http/centos7.ks.in b/centos7/http/centos7.ks.in index 6a1f324b..92ff3d58 100644 --- a/centos7/http/centos7.ks.in +++ b/centos7/http/centos7.ks.in @@ -1,4 +1,4 @@ -url --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os" ${KS_PROXY} +url --mirrorlist="${KS_MIRROR}/?release=7&arch=x86_64&repo=os" ${KS_PROXY} poweroff firewall --enabled --service=ssh firstboot --disable @@ -12,8 +12,8 @@ timezone UTC --isUtc bootloader --location=mbr --driveorder="vda" --timeout=1 rootpw --plaintext password -repo --name="Updates" --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates" ${KS_PROXY} -repo --name="Extras" --mirrorlist="http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras" ${KS_PROXY} +repo --name="Updates" --mirrorlist="${KS_MIRROR}/?release=7&arch=x86_64&repo=updates" ${KS_PROXY} +repo --name="Extras" --mirrorlist="${KS_MIRROR}/?release=7&arch=x86_64&repo=extras" ${KS_PROXY} zerombr clearpart --all --initlabel diff --git a/centos8/Makefile b/centos8/Makefile index 976d7c83..c1595a0c 100644 --- a/centos8/Makefile +++ b/centos8/Makefile @@ -4,8 +4,8 @@ include ../scripts/check.mk PACKER ?= packer PACKER_LOG ?= 0 - -export PACKER_LOG KS_PROXY +KS_MIRROR ?= http://mirrorlist.centos.org +export PACKER_LOG KS_PROXY KS_MIRROR .PHONY: all clean @@ -17,7 +17,7 @@ centos8.tar.gz: check-deps clean http/centos8.ks ${PACKER} init centos8.pkr.hcl && ${PACKER} build centos8.pkr.hcl http/centos8.ks: http/centos8.ks.in - envsubst '$${KS_PROXY}' < $< | tee $@ + envsubst '$${KS_PROXY} $${KS_MIRROR}' < $< | tee $@ clean: ${RM} -rf output-centos8 centos8.tar.gz http/centos8.ks diff --git a/centos8/http/centos8.ks.in b/centos8/http/centos8.ks.in index 3bdf72b4..f7d2c824 100644 --- a/centos8/http/centos8.ks.in +++ b/centos8/http/centos8.ks.in @@ -1,4 +1,4 @@ -url --mirrorlist="http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS" ${KS_PROXY} +url --mirrorlist="${KS_MIRROR}/?release=8&arch=x86_64&repo=BaseOS" ${KS_PROXY} poweroff firewall --enabled --service=ssh firstboot --disable @@ -12,8 +12,8 @@ timezone UTC --isUtc bootloader --location=mbr --driveorder="vda" --timeout=1 rootpw --plaintext password -repo --name="AppStream" --mirrorlist="http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream" ${KS_PROXY} -repo --name="Extras" --mirrorlist="http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=extras" ${KS_PROXY} +repo --name="AppStream" --mirrorlist="${KS_MIRROR}/?release=8&arch=x86_64&repo=AppStream" ${KS_PROXY} +repo --name="Extras" --mirrorlist="${KS_MIRROR}/?release=8&arch=x86_64&repo=extras" ${KS_PROXY} zerombr clearpart --all --initlabel