Harden multi-architecture release pipeline
This commit is contained in:
23 files changed
+557
-271
No files matched your search
+40
-33
@@ -25,31 +25,21 @@ SKIP_PROD_CHECK=false
|
||||
FAST_RING_ONLY=false
|
||||
BOOTSTRAP=false
|
||||
PACKAGES=""
|
||||
ALL_ARCHES=false
|
||||
|
||||
# Kept for --arch all, which re-invokes this script per architecture with the
|
||||
# other arguments unchanged (minus the --arch all pair itself).
|
||||
ORIGINAL_ARGS=()
|
||||
skip_next=false
|
||||
prev=""
|
||||
arch_option=false
|
||||
for arg in "$@"; do
|
||||
if [[ "$skip_next" == true ]]; then
|
||||
skip_next=false
|
||||
prev=""
|
||||
continue
|
||||
if [[ "$arch_option" == true ]]; then
|
||||
[[ "$arg" != "all" ]] && ORIGINAL_ARGS+=("--arch" "$arg")
|
||||
arch_option=false
|
||||
elif [[ "$arg" == "--arch" ]]; then
|
||||
arch_option=true
|
||||
else
|
||||
ORIGINAL_ARGS+=("$arg")
|
||||
fi
|
||||
if [[ "$arg" == "--arch" ]]; then
|
||||
prev="--arch"
|
||||
continue
|
||||
fi
|
||||
if [[ "$prev" == "--arch" ]]; then
|
||||
prev=""
|
||||
if [[ "$arg" == "all" ]]; then
|
||||
continue
|
||||
fi
|
||||
ORIGINAL_ARGS+=("--arch" "$arg")
|
||||
continue
|
||||
fi
|
||||
ORIGINAL_ARGS+=("$arg")
|
||||
done
|
||||
|
||||
usage() {
|
||||
@@ -93,21 +83,13 @@ while [[ $# -gt 0 ]]; do
|
||||
;;
|
||||
--arch)
|
||||
if [[ "$2" == "all" ]]; then
|
||||
# A release train advances every published architecture together; a
|
||||
# channel that moved for one and not another would serve mismatched
|
||||
# versions to users on the two. Re-run this script once per
|
||||
# architecture with the same arguments, stopping at the first failure
|
||||
# so the operator sees which architecture is stuck (the advance is
|
||||
# idempotent, so re-running with --arch all resumes where it stopped).
|
||||
shift 2
|
||||
for arch in $(published_arches); do
|
||||
"$0" --arch "$arch" "${ORIGINAL_ARGS[@]}" || exit $?
|
||||
done
|
||||
exit 0
|
||||
ALL_ARCHES=true
|
||||
ARCH=all
|
||||
else
|
||||
require_valid_arch "$2"
|
||||
ARCH="$2"
|
||||
update_arch_paths
|
||||
fi
|
||||
require_valid_arch "$2"
|
||||
ARCH="$2"
|
||||
update_arch_paths
|
||||
shift 2
|
||||
;;
|
||||
--package)
|
||||
@@ -175,6 +157,31 @@ case "$FROM->$TO" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$ALL_ARCHES" == true ]]; then
|
||||
# Hold one lock across the whole operation so a timer cannot mutate a
|
||||
# channel between architectures. Check every source database before moving
|
||||
# the first one; a failed sync can still require an idempotent retry, but a
|
||||
# missing architecture never creates a knowingly partial advance.
|
||||
if [[ "$DRY_RUN" != true ]]; then
|
||||
acquire_release_lock || exit 1
|
||||
fi
|
||||
|
||||
ARCHES=$(published_arches)
|
||||
for arch in $ARCHES; do
|
||||
source_db="$REPO_ROOT/$FROM/$arch/omarchy.db.tar.zst"
|
||||
if [[ ! -f "$source_db" ]]; then
|
||||
print_error "Source database not found: $source_db"
|
||||
echo "Nothing has been published to the $FROM channel for $arch."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
for arch in $ARCHES; do
|
||||
"$0" --arch "$arch" "${ORIGINAL_ARGS[@]}" || exit $?
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
SOURCE_DIR="$REPO_ROOT/$FROM/$ARCH"
|
||||
TARGET_DIR="$REPO_ROOT/$TO/$ARCH"
|
||||
SOURCE_DB="$SOURCE_DIR/omarchy.db.tar.zst"
|
||||
|
||||
Reference in new issue
Block a user