ci: skip Alpine builds already published
Build Alpine Packages / build-and-publish (v3.24, 3.24) (pull_request) Canceled after 1h11m37s
Build Alpine Packages / build-and-publish (v3.24, 3.24) (pull_request) Canceled after 1h11m37s
This commit is contained in:
+11
-12
@@ -11,30 +11,27 @@ repo_dir="${repo_root}/packages/${repo_name}/${arch}"
|
||||
registry_url="${ALPINE_REGISTRY_URL:-}"
|
||||
registry_key="${ALPINE_REGISTRY_KEY:-}"
|
||||
read -r -a package_list <<< "${packages}"
|
||||
declare -A versioned_packages=()
|
||||
declare -A source_packages=()
|
||||
|
||||
while IFS= read -r package_dir; do
|
||||
while IFS= read -r spec; do
|
||||
versioned_packages["${spec%%=*}"]="${spec}"
|
||||
source_packages["${spec%%=*}"]=1
|
||||
done < <(apk_package_versioned_names "${package_dir}" "${arch}")
|
||||
done < <(apk_all_package_dirs "${repo_root}")
|
||||
|
||||
for package in "${package_list[@]}"; do
|
||||
if [[ -z "${versioned_packages[${package}]:-}" ]]; then
|
||||
if [[ -z "${source_packages[${package}]:-}" ]]; then
|
||||
printf 'smoke package is not defined by a source APKBUILD: %s\n' "${package}" >&2
|
||||
exit 2
|
||||
fi
|
||||
package="${versioned_packages[${package}]}"
|
||||
done
|
||||
|
||||
if [[ -d "${repo_dir}" ]]; then
|
||||
cp "${repo_dir}"/*.rsa.pub /etc/apk/keys/
|
||||
echo "${repo_root}/packages/${repo_name}" >> /etc/apk/repositories
|
||||
else
|
||||
if [[ -z "${registry_url}" ]]; then
|
||||
printf 'missing local repository and no registry fallback: packages/%s/%s\n' "${repo_name}" "${arch}" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n "${registry_url}" ]]; then
|
||||
if [[ ! -f "${registry_key}" ]]; then
|
||||
printf 'missing Alpine registry signing key: %s\n' "${registry_key:-<unset>}" >&2
|
||||
exit 1
|
||||
@@ -43,9 +40,11 @@ else
|
||||
echo "${registry_url}" >> /etc/apk/repositories
|
||||
fi
|
||||
|
||||
for index in "${!package_list[@]}"; do
|
||||
package_list[index]="${versioned_packages[${package_list[index]}]}"
|
||||
done
|
||||
if [[ ! -d "${repo_dir}" && -z "${registry_url}" ]]; then
|
||||
printf 'missing local repository and no registry fallback: packages/%s/%s\n' "${repo_name}" "${arch}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
apk update
|
||||
apk add "${package_list[@]}"
|
||||
if command -v weed >/dev/null 2>&1; then
|
||||
|
||||
Reference in New Issue
Block a user