mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Fix sync of CircleCI orb
Fix the case where there is no circleci config in a repo. * Add echo_yellow() for warnings. * Send echo_COLOR output to stderr to not be in function output. * Make check_circleci_orb curl failure a warning. Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
parent
632678a461
commit
141dcbb87f
|
@ -15,14 +15,19 @@ orgs="prometheus prometheus-community"
|
||||||
|
|
||||||
color_red='\e[31m'
|
color_red='\e[31m'
|
||||||
color_green='\e[32m'
|
color_green='\e[32m'
|
||||||
|
color_yellow='\e[33m'
|
||||||
color_none='\e[0m'
|
color_none='\e[0m'
|
||||||
|
|
||||||
echo_red() {
|
echo_red() {
|
||||||
echo -e "${color_red}$@${color_none}"
|
echo -e "${color_red}$@${color_none}" 1>&2
|
||||||
}
|
}
|
||||||
|
|
||||||
echo_green() {
|
echo_green() {
|
||||||
echo -e "${color_green}$@${color_none}"
|
echo -e "${color_green}$@${color_none}" 1>&2
|
||||||
|
}
|
||||||
|
|
||||||
|
echo_yellow() {
|
||||||
|
echo -e "${color_yellow}$@${color_none}" 1>&2
|
||||||
}
|
}
|
||||||
|
|
||||||
GITHUB_TOKEN="${GITHUB_TOKEN:-}"
|
GITHUB_TOKEN="${GITHUB_TOKEN:-}"
|
||||||
|
@ -100,8 +105,8 @@ check_circleci_orb() {
|
||||||
|
|
||||||
orb_version="$(curl -sL --fail "${ci_config_url}" | yq eval '.orbs.prometheus' -)"
|
orb_version="$(curl -sL --fail "${ci_config_url}" | yq eval '.orbs.prometheus' -)"
|
||||||
if [[ -z "${orb_version}" ]]; then
|
if [[ -z "${orb_version}" ]]; then
|
||||||
echo_red "ERROR: Failed to fetch CirleCI orb version from '${org_repo}'"
|
echo_yellow "WARNING: Failed to fetch CirleCI orb version from '${org_repo}'"
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${orb_version}" != "null" && "${orb_version}" != "${prometheus_orb_version}" ]]; then
|
if [[ "${orb_version}" != "null" && "${orb_version}" != "${prometheus_orb_version}" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue