Optimize Alpine packaging workflow
Build Alpine Packages / build-and-publish (v3.24, 3.24) (push) Successful in 2h16m43s
Build Alpine Packages / build-and-publish (v3.24, 3.24) (push) Successful in 2h16m43s
This commit is contained in:
@@ -10,6 +10,7 @@ arch="${ALPINE_ARCH:-x86_64}"
|
||||
platform="${ALPINE_TEST_PLATFORM:-linux/amd64}"
|
||||
repo_dir="${repo_root}/packages/${repo_name}/${arch}"
|
||||
runtime_mode="${ALPINE_RUNTIME_TEST_MODE:-auto}"
|
||||
runtime_image="${ALPINE_RUNTIME_TEST_IMAGE:-alpine-apk-runtime-test:${alpine_version}}"
|
||||
|
||||
validate_repo() {
|
||||
if [[ ! -d "${repo_dir}" ]]; then
|
||||
@@ -66,10 +67,9 @@ run_hook_docker() {
|
||||
-e "PACKAGE_NAME=${package_name}" \
|
||||
-v "${repo_root}:/work:ro" \
|
||||
-v "${repo_root}/packages/${repo_name}:/repo:ro" \
|
||||
"alpine:${alpine_version}" \
|
||||
"${runtime_image}" \
|
||||
sh -lc '
|
||||
set -e
|
||||
apk add --no-cache bash openrc >/dev/null
|
||||
cp "/repo/${ALPINE_ARCH}"/*.rsa.pub /etc/apk/keys/
|
||||
printf "%s\n" /repo >> /etc/apk/repositories
|
||||
apk update
|
||||
@@ -79,6 +79,15 @@ run_hook_docker() {
|
||||
'
|
||||
}
|
||||
|
||||
build_runtime_image() {
|
||||
docker build \
|
||||
--platform "${platform}" \
|
||||
--build-arg "ALPINE_VERSION=${alpine_version}" \
|
||||
-f "${repo_root}/scripts/apk/runtime-test.Dockerfile" \
|
||||
-t "${runtime_image}" \
|
||||
"${repo_root}"
|
||||
}
|
||||
|
||||
validate_repo
|
||||
|
||||
case "${runtime_mode}" in
|
||||
@@ -99,6 +108,8 @@ esac
|
||||
|
||||
if [[ "${runtime_mode}" == "direct" ]]; then
|
||||
prepare_direct_runtime
|
||||
else
|
||||
build_runtime_image
|
||||
fi
|
||||
|
||||
while IFS= read -r package_dir; do
|
||||
|
||||
Reference in New Issue
Block a user