Stop syncing CircleCI orb version

Prometheus repo nolonger uses the CircleCI orb, remove the sync.

Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
SuperQ 2022-09-16 10:55:26 +02:00
parent f1a3dbbb6b
commit 82f53442c6
No known key found for this signature in database
GPG key ID: C646B23C9E3245F1

View file

@ -47,12 +47,6 @@ source_dir="$(pwd)"
tmp_dir="$(mktemp -d)" tmp_dir="$(mktemp -d)"
trap 'rm -rf "${tmp_dir}"' EXIT trap 'rm -rf "${tmp_dir}"' EXIT
prometheus_orb_version="$(yq eval '.orbs.prometheus' .circleci/config.yml)"
if [[ -z "${prometheus_orb_version}" ]]; then
echo_red '"ERROR: Unable to get CircleCI orb version'
exit 1
fi
## Internal functions ## Internal functions
github_api() { github_api() {
local url local url
@ -105,24 +99,6 @@ check_go() {
curl -sLf -o /dev/null "https://raw.githubusercontent.com/${org_repo}/${default_branch}/go.mod" curl -sLf -o /dev/null "https://raw.githubusercontent.com/${org_repo}/${default_branch}/go.mod"
} }
check_circleci_orb() {
local org_repo
local default_branch
org_repo="$1"
default_branch="$2"
local ci_config_url="https://raw.githubusercontent.com/${org_repo}/${default_branch}/.circleci/config.yml"
orb_version="$(curl -sL --fail "${ci_config_url}" | yq eval '.orbs.prometheus' -)"
if [[ -z "${orb_version}" ]]; then
echo_yellow "WARNING: Failed to fetch CirleCI orb version from '${org_repo}'"
return 0
fi
if [[ "${orb_version}" != "null" && "${orb_version}" != "${prometheus_orb_version}" ]]; then
echo "CircleCI-orb"
fi
}
process_repo() { process_repo() {
local org_repo local org_repo
local default_branch local default_branch
@ -168,13 +144,6 @@ process_repo() {
needs_update+=("${source_file}") needs_update+=("${source_file}")
done done
local circleci
circleci="$(check_circleci_orb "${org_repo}" "${default_branch}")"
if [[ -n "${circleci}" ]]; then
echo "${circleci} needs updating."
needs_update+=("${circleci}")
fi
if [[ "${#needs_update[@]}" -eq 0 ]] ; then if [[ "${#needs_update[@]}" -eq 0 ]] ; then
echo "No files need sync." echo "No files need sync."
return return
@ -191,7 +160,6 @@ process_repo() {
# Update the files in target repo by one from prometheus/prometheus. # Update the files in target repo by one from prometheus/prometheus.
for source_file in "${needs_update[@]}"; do for source_file in "${needs_update[@]}"; do
case "${source_file}" in case "${source_file}" in
CircleCI-orb) yq eval -i ".orbs.prometheus = \"${prometheus_orb_version}\"" .circleci/config.yml ;;
*) cp -f "${source_dir}/${source_file}" "./${source_file}" ;; *) cp -f "${source_dir}/${source_file}" "./${source_file}" ;;
esac esac
done done