mirror of
https://gitlab.archlinux.org/archlinux/archlinux-docker.git
synced 2026-01-09 11:21:44 +01:00
Always retrieve the latest package from the API
Without this stuff fails after a while since the API is paginated and sorted by ASC by default.
This commit is contained in:
parent
73504a73cd
commit
9c39d53baf
@ -4,6 +4,6 @@ set -eu
|
||||
|
||||
package_name=$1
|
||||
|
||||
package_id=$(curl -sSf --header "PRIVATE-TOKEN: ${GITLAB_PROJECT_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages" | jq ".[] | select(.version == \"${BUILD_VERSION}\") | .id")
|
||||
package_id=$(curl -sSf --header "PRIVATE-TOKEN: ${GITLAB_PROJECT_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages?sort=desc&per_page=1" | jq ".[] | select(.version == \"${BUILD_VERSION}\") | .id")
|
||||
package_file_id=$(curl -sSf --header "PRIVATE-TOKEN: ${GITLAB_PROJECT_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/${package_id}/package_files" | jq ".[] | select(.file_name == \"$package_name\") | .id")
|
||||
echo "https://gitlab.archlinux.org/archlinux/archlinux-docker/-/package_files/${package_file_id}/download"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user