2abf3d0edb
CI / test (push) Failing after 7m51s
Повтор run 109 на теге v0.1.1 брал старый promote; promote/prune теперь клонируют EventHubDevOps с master, dispatch позволяет указать sha и tag. Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
812 B
Bash
26 lines
812 B
Bash
#!/usr/bin/env bash
|
|
# CI: clone EventHubDevOps и вызвать скрипт (не зависит от checkout тега).
|
|
# Usage: clone-devops-run.sh <script-relative-to-devops> [args...]
|
|
set -euo pipefail
|
|
|
|
SCRIPT_REL="${1:?script path under devops/, e.g. scripts/promote-images.sh}"
|
|
shift
|
|
|
|
DEVOPS_REPO="${DEVOPS_REPO:-https://git.sabilin.com/EventHub/EventHubDevOps.git}"
|
|
DEVOPS_REF="${DEVOPS_REF:-master}"
|
|
|
|
if [[ -z "${REGISTRY_USER:-}" || -z "${REGISTRY_PASSWORD:-}" ]]; then
|
|
echo "REGISTRY_USER/PASSWORD required"
|
|
exit 1
|
|
fi
|
|
|
|
WORKDIR="$(mktemp -d)"
|
|
trap 'rm -rf "${WORKDIR}"' EXIT
|
|
|
|
repo_path="${DEVOPS_REPO#https://}"
|
|
git clone --depth 1 --branch "${DEVOPS_REF}" \
|
|
"https://${REGISTRY_USER}:${REGISTRY_PASSWORD}@${repo_path}" \
|
|
"${WORKDIR}/devops"
|
|
|
|
exec bash "${WORKDIR}/devops/${SCRIPT_REL}" "$@"
|