Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
archlinux-docker
Commits
c1cc41db
Verified
Commit
c1cc41db
authored
Nov 13, 2020
by
hashworks
Browse files
Fail public download script on API / json parsing errors
parent
9c39d53b
Pipeline
#2916
passed with stages
in 3 minutes and 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ci/get-public-download-for-generic-package.sh
View file @
c1cc41db
...
...
@@ -5,5 +5,17 @@ set -eu
package_name
=
$1
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"
)
if
[[
-z
"
${
package_id
}
"
]]
;
then
>
&2
echo
"Error: No package id found"
exit
1
fi
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"
)
if
[[
-z
"
${
package_file_id
}
"
]]
;
then
>
&2
echo
"Error: No package file id found"
exit
1
fi
echo
"https://gitlab.archlinux.org/archlinux/archlinux-docker/-/package_files/
${
package_file_id
}
/download"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment