mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-10 06:14:13 +00:00
feat: version updater use case statement
Co-authored-by: Ben Kochie <superq@gmail.com> Signed-off-by: Oleg Klyuchkin <anviar@users.noreply.github.com>
This commit is contained in:
parent
ec522a0a3e
commit
82e81f7e57
1 changed files with 12 additions and 10 deletions
22
.github/scripts/version_updater.sh
vendored
22
.github/scripts/version_updater.sh
vendored
|
@ -75,16 +75,18 @@ if [[ -z "${role}" ]]; then
|
|||
fi
|
||||
|
||||
# Get latest version.
|
||||
if [[ "${type}" == "github" ]]
|
||||
then
|
||||
version="$(github_api "repos/${source_repo}/releases/latest" | jq '.tag_name' | tr -d '"v')"
|
||||
elif [[ "${type}" == "gitlab" ]]
|
||||
then
|
||||
version="$(gitlab_api "projects/${source_repo}/releases" | jq '.[0].tag_name' | tr -d '"v')"
|
||||
else
|
||||
echo_red 'Unknown source type. Terminating.'
|
||||
exit 128
|
||||
fi
|
||||
case "${type}" in
|
||||
github)
|
||||
version="$(github_api "repos/${source_repo}/releases/latest" | jq '.tag_name' | tr -d '"v')"
|
||||
;;
|
||||
gitlab)
|
||||
version="$(gitlab_api "projects/${source_repo}/releases" | jq '.[0].tag_name' | tr -d '"v')"
|
||||
;;
|
||||
*)
|
||||
echo_red 'Unknown source type. Terminating.'
|
||||
exit 128
|
||||
;;
|
||||
esac
|
||||
echo_green "New ${source_repo} version is: ${version}"
|
||||
|
||||
# Download destination repository
|
||||
|
|
Loading…
Reference in a new issue