Add stable / edge

This commit is contained in:
Ryan Hughes committed 2025-11-10 11:03:39 -05:00
1 parent 92677d3df0
commit 4b5342ba66
9 files changed
+159 -33

No files matched your search

+15 -3
View File
@@ -25,6 +25,14 @@ while [[ $# -gt 0 ]]; do
update_arch_paths update_arch_paths
shift 2 shift 2
;; ;;
--mirror)
MIRROR="$2"
if [[ "$MIRROR" != "edge" && "$MIRROR" != "stable" ]]; then
print_error "Invalid mirror: $MIRROR (must be 'edge' or 'stable')"
exit 1
fi
shift 2
;;
--package) --package)
shift shift
PACKAGES="" PACKAGES=""
@@ -39,6 +47,7 @@ while [[ $# -gt 0 ]]; do
echo "" echo ""
echo "Options:" echo "Options:"
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)" echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
echo " --mirror <mirror> Mirror to use (edge or stable, default: edge)"
echo " --package <names> Build only the specified package(s) (space-separated)" echo " --package <names> Build only the specified package(s) (space-separated)"
echo " -h, --help Show this help message" echo " -h, --help Show this help message"
echo "" echo ""
@@ -51,6 +60,7 @@ while [[ $# -gt 0 ]]; do
echo "" echo ""
echo "Examples:" echo "Examples:"
echo " $0 --arch aarch64" echo " $0 --arch aarch64"
echo " $0 --mirror stable"
echo " $0 --package yay" echo " $0 --package yay"
echo " $0 --package yay elephant cursor-bin" echo " $0 --package yay elephant cursor-bin"
echo "" echo ""
@@ -63,8 +73,9 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
# Show target architecture after parsing args # Show target architecture and mirror after parsing args
print_info "Target architecture: $ARCH" print_info "Target architecture: $ARCH"
print_info "Mirror: $MIRROR"
print_info "Build workspace: $BUILD_OUTPUT_DIR" print_info "Build workspace: $BUILD_OUTPUT_DIR"
print_info "Final output: $REPO_DIR" print_info "Final output: $REPO_DIR"
@@ -93,7 +104,7 @@ else
fi fi
# Build/update the Docker image # Build/update the Docker image
build_docker_image "$BUILD_DIR" "$ARCH" build_docker_image "$BUILD_DIR" "$ARCH" "$MIRROR"
print_info "Running AUR package build..." print_info "Running AUR package build..."
@@ -105,6 +116,7 @@ make_dir_writable "$REPO_DIR"
DOCKER_ARGS=( DOCKER_ARGS=(
--rm --rm
-e ARCH="$ARCH" -e ARCH="$ARCH"
-e MIRROR="$MIRROR"
-e PACKAGES="$PACKAGES" -e PACKAGES="$PACKAGES"
-v "$BUILD_ROOT/build-output:/build-output" -v "$BUILD_ROOT/build-output:/build-output"
-v "$BUILD_ROOT/pkgs.omarchy.org:/pkgs.omarchy.org" -v "$BUILD_ROOT/pkgs.omarchy.org:/pkgs.omarchy.org"
@@ -113,7 +125,7 @@ DOCKER_ARGS=(
) )
# Run the builder with assembled args # Run the builder with assembled args
IMAGE_TAG="omarchy-pkg-builder:latest-$ARCH" IMAGE_TAG="omarchy-pkg-builder:latest-$ARCH-$MIRROR"
PLATFORM_ARG=$(get_platform_arg "$ARCH") PLATFORM_ARG=$(get_platform_arg "$ARCH")
docker run $PLATFORM_ARG "${DOCKER_ARGS[@]}" "$IMAGE_TAG" /build/build.sh docker run $PLATFORM_ARG "${DOCKER_ARGS[@]}" "$IMAGE_TAG" /build/build.sh
+22 -5
View File
@@ -146,6 +146,11 @@ show_disk_usage() {
# Main execution # Main execution
main() { main() {
print_header "Omarchy Repository Cleaner" print_header "Omarchy Repository Cleaner"
print_info "Mirror: $MIRROR"
print_info "Architecture: $ARCH"
print_info "Repository: $REPO_DIR"
echo ""
# Parse command line arguments # Parse command line arguments
DRY_RUN=false DRY_RUN=false
@@ -154,6 +159,16 @@ main() {
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
--arch)
ARCH="$2"
update_arch_paths
shift 2
;;
--mirror)
MIRROR="$2"
update_arch_paths
shift 2
;;
--keep) --keep)
KEEP_VERSIONS="$2" KEEP_VERSIONS="$2"
shift 2 shift 2
@@ -174,11 +189,13 @@ main() {
echo "Usage: $0 [OPTIONS]" echo "Usage: $0 [OPTIONS]"
echo "" echo ""
echo "Options:" echo "Options:"
echo " --keep N Keep N versions of each package (default: 2)" echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
echo " --dry-run Preview what would be removed without removing" echo " --mirror <mirror> Mirror to use (edge or stable, default: edge)"
echo " --all Remove ALL packages (dangerous!)" echo " --keep N Keep N versions of each package (default: 2)"
echo " --usage Show disk usage statistics" echo " --dry-run Preview what would be removed without removing"
echo " -h, --help Show this help message" echo " --all Remove ALL packages (dangerous!)"
echo " --usage Show disk usage statistics"
echo " -h, --help Show this help message"
echo "" echo ""
echo "Examples:" echo "Examples:"
echo " $0 # Keep 2 versions (default)" echo " $0 # Keep 2 versions (default)"
+34 -1
View File
@@ -4,15 +4,48 @@
SCRIPT_DIR=$(realpath "${BASH_SOURCE[0]%/*}") SCRIPT_DIR=$(realpath "${BASH_SOURCE[0]%/*}")
BUILD_ROOT=$(realpath "$SCRIPT_DIR/..") BUILD_ROOT=$(realpath "$SCRIPT_DIR/..")
source "$BUILD_ROOT/helpers/message-helpers.sh"
source "$BUILD_ROOT/helpers/paths.sh" source "$BUILD_ROOT/helpers/paths.sh"
# Parse arguments
while [[ $# -gt 0 ]]; do
case $1 in
--arch)
ARCH="$2"
update_arch_paths
shift 2
;;
--mirror)
MIRROR="$2"
update_arch_paths
shift 2
;;
-h | --help)
echo "Usage: $0 [OPTIONS]"
echo ""
echo "Options:"
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
echo " --mirror <mirror> Mirror to use (edge or stable, default: edge)"
echo " -h, --help Show this help message"
exit 0
;;
*)
print_error "Unknown option: $1"
exit 1
;;
esac
done
DB_FILE="$REPO_DIR/omarchy.db.tar.zst" DB_FILE="$REPO_DIR/omarchy.db.tar.zst"
if [[ ! -f "$DB_FILE" ]]; then if [[ ! -f "$DB_FILE" ]]; then
echo "Repository database not found" echo "Repository database not found: $DB_FILE"
exit 1 exit 1
fi fi
echo "Packages in $MIRROR mirror ($ARCH):"
echo ""
# Extract package names and versions from database # Extract package names and versions from database
tar -xOf "$DB_FILE" --wildcards "*/desc" 2>/dev/null | tar -xOf "$DB_FILE" --wildcards "*/desc" 2>/dev/null |
awk '/%NAME%/{getline; name=$0} awk '/%NAME%/{getline; name=$0}
+10 -3
View File
@@ -18,6 +18,11 @@ while [[ $# -gt 0 ]]; do
update_arch_paths update_arch_paths
shift 2 shift 2
;; ;;
--mirror)
MIRROR="$2"
update_arch_paths
shift 2
;;
--dry-run) --dry-run)
DRY_RUN=true DRY_RUN=true
shift shift
@@ -26,9 +31,10 @@ while [[ $# -gt 0 ]]; do
echo "Usage: $0 [OPTIONS]" echo "Usage: $0 [OPTIONS]"
echo "" echo ""
echo "Options:" echo "Options:"
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)" echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
echo " --dry-run Show what would be copied without copying" echo " --mirror <mirror> Mirror to use (edge or stable, default: edge)"
echo " -h, --help Show this help message" echo " --dry-run Show what would be copied without copying"
echo " -h, --help Show this help message"
echo "" echo ""
echo "This script promotes packages from build-output/ to pkgs.omarchy.org/" echo "This script promotes packages from build-output/ to pkgs.omarchy.org/"
exit 0 exit 0
@@ -40,6 +46,7 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
print_info "Mirror: $MIRROR"
print_info "Build output: $BUILD_OUTPUT_DIR" print_info "Build output: $BUILD_OUTPUT_DIR"
print_info "Final output: $REPO_DIR" print_info "Final output: $REPO_DIR"
+9 -4
View File
@@ -30,6 +30,10 @@ while [[ $# -gt 0 ]]; do
BUILD_ARGS+=("--arch" "$2") BUILD_ARGS+=("--arch" "$2")
shift 2 shift 2
;; ;;
--mirror)
BUILD_ARGS+=("--mirror" "$2")
shift 2
;;
--package) --package)
BUILD_ARGS+=("--package" "$2") BUILD_ARGS+=("--package" "$2")
shift 2 shift 2
@@ -47,6 +51,7 @@ while [[ $# -gt 0 ]]; do
echo "" echo ""
echo "Options:" echo "Options:"
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)" echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
echo " --mirror <mirror> Mirror to use (edge or stable, default: edge)"
echo " --package <name> Build only the specified package" echo " --package <name> Build only the specified package"
echo " --sync-remote <path> Rclone remote for sync (default: pkgs.omarchy.org:omarchy-pkgs)" echo " --sync-remote <path> Rclone remote for sync (default: pkgs.omarchy.org:omarchy-pkgs)"
echo " --skip-prod-check Skip production environment check during sync" echo " --skip-prod-check Skip production environment check during sync"
@@ -74,7 +79,7 @@ print_info "Step 1/5: Building packages..."
# Step 2: Sign # Step 2: Sign
echo "" echo ""
print_info "Step 2/5: Signing packages..." print_info "Step 2/5: Signing packages..."
"$BUILD_ROOT/bin/sign" --arch "$ARCH" || { "$BUILD_ROOT/bin/sign" --arch "$ARCH" --mirror "$MIRROR" || {
print_error "Signing failed" print_error "Signing failed"
exit 1 exit 1
} }
@@ -82,7 +87,7 @@ print_info "Step 2/5: Signing packages..."
# Step 3: Promote # Step 3: Promote
echo "" echo ""
print_info "Step 3/5: Promoting to production..." print_info "Step 3/5: Promoting to production..."
"$BUILD_ROOT/bin/promote-build" --arch "$ARCH" || { "$BUILD_ROOT/bin/promote-build" --arch "$ARCH" --mirror "$MIRROR" || {
print_error "Promotion failed" print_error "Promotion failed"
exit 1 exit 1
} }
@@ -90,7 +95,7 @@ print_info "Step 3/5: Promoting to production..."
# Step 4: Clean (which also updates the repo) # Step 4: Clean (which also updates the repo)
echo "" echo ""
print_info "Step 4/5: Cleaning old versions..." print_info "Step 4/5: Cleaning old versions..."
"$BUILD_ROOT/bin/clean-repo" || { "$BUILD_ROOT/bin/clean-repo" --arch "$ARCH" --mirror "$MIRROR" || {
print_error "Cleaning failed" print_error "Cleaning failed"
exit 1 exit 1
} }
@@ -98,7 +103,7 @@ print_info "Step 4/5: Cleaning old versions..."
# Step 5: Sync # Step 5: Sync
echo "" echo ""
print_info "Step 5/5: Syncing to remote..." print_info "Step 5/5: Syncing to remote..."
SYNC_ARGS=("pkgs.omarchy.org/$ARCH") SYNC_ARGS=("pkgs.omarchy.org/$MIRROR/$ARCH")
if [[ -n "$SYNC_REMOTE" ]]; then if [[ -n "$SYNC_REMOTE" ]]; then
SYNC_ARGS+=("--remote" "$SYNC_REMOTE") SYNC_ARGS+=("--remote" "$SYNC_REMOTE")
fi fi
+41 -6
View File
@@ -8,16 +8,50 @@ source "$BUILD_ROOT/helpers/paths.sh"
print_header "Remove Package" print_header "Remove Package"
if [[ -z "$1" ]]; then # Parse arguments
PACKAGE_NAME=""
while [[ $# -gt 0 ]]; do
case $1 in
--arch)
ARCH="$2"
update_arch_paths
shift 2
;;
--mirror)
MIRROR="$2"
update_arch_paths
shift 2
;;
-h | --help)
echo "Usage: $0 <package-name> [OPTIONS]"
echo ""
echo "Options:"
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
echo " --mirror <mirror> Mirror to use (edge or stable, default: edge)"
echo " -h, --help Show this help message"
exit 0
;;
*)
if [[ -z "$PACKAGE_NAME" ]]; then
PACKAGE_NAME="$1"
else
print_error "Unknown option: $1"
exit 1
fi
shift
;;
esac
done
if [[ -z "$PACKAGE_NAME" ]]; then
print_error "Package name required" print_error "Package name required"
echo "" echo ""
echo "Usage: $0 <package-name>" echo "Usage: $0 <package-name> [OPTIONS]"
exit 1 exit 1
fi fi
PACKAGE_NAME="$1"
print_info "Target architecture: $ARCH" print_info "Target architecture: $ARCH"
print_info "Mirror: $MIRROR"
print_info "Repository: $REPO_DIR" print_info "Repository: $REPO_DIR"
# Check if repository exists # Check if repository exists
@@ -53,7 +87,7 @@ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
fi fi
# Build/update the Docker image (always use x86_64 for removal - it's architecture independent) # Build/update the Docker image (always use x86_64 for removal - it's architecture independent)
build_docker_image "$BUILD_DIR" "x86_64" build_docker_image "$BUILD_DIR" "x86_64" "$MIRROR"
print_info "Removing package..." print_info "Removing package..."
@@ -63,9 +97,10 @@ make_dir_writable "$REPO_DIR"
# Run the removal script in Docker (always use x86_64 image) # Run the removal script in Docker (always use x86_64 image)
docker run --rm --platform linux/amd64 \ docker run --rm --platform linux/amd64 \
-e ARCH="$ARCH" \ -e ARCH="$ARCH" \
-e MIRROR="$MIRROR" \
-v "$BUILD_ROOT/pkgs.omarchy.org:/pkgs.omarchy.org" \ -v "$BUILD_ROOT/pkgs.omarchy.org:/pkgs.omarchy.org" \
-v "$BUILD_DIR:/build:ro" \ -v "$BUILD_DIR:/build:ro" \
omarchy-pkg-builder:latest-x86_64 /build/remove-package.sh "$PACKAGE_NAME" omarchy-pkg-builder:latest-x86_64-$MIRROR /build/remove-package.sh "$PACKAGE_NAME"
RESULT=$? RESULT=$?
+12 -4
View File
@@ -18,12 +18,18 @@ while [[ $# -gt 0 ]]; do
update_arch_paths update_arch_paths
shift 2 shift 2
;; ;;
--mirror)
MIRROR="$2"
update_arch_paths
shift 2
;;
-h | --help) -h | --help)
echo "Usage: $0 [OPTIONS]" echo "Usage: $0 [OPTIONS]"
echo "" echo ""
echo "Options:" echo "Options:"
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)" echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
echo " -h, --help Show this help message" echo " --mirror <mirror> Mirror to use (edge or stable, default: edge)"
echo " -h, --help Show this help message"
echo "" echo ""
echo "This script signs all packages in build-output/" echo "This script signs all packages in build-output/"
exit 0 exit 0
@@ -36,6 +42,7 @@ while [[ $# -gt 0 ]]; do
done done
print_info "Target architecture: $ARCH" print_info "Target architecture: $ARCH"
print_info "Mirror: $MIRROR"
print_info "Build output: $BUILD_OUTPUT_DIR" print_info "Build output: $BUILD_OUTPUT_DIR"
# Check if build output exists # Check if build output exists
@@ -60,7 +67,7 @@ if [[ -z "$GPG_PASSPHRASE" ]]; then
fi fi
# Build/update the Docker image (always use x86_64 for signing - it's architecture independent) # Build/update the Docker image (always use x86_64 for signing - it's architecture independent)
build_docker_image "$BUILD_DIR" "x86_64" build_docker_image "$BUILD_DIR" "x86_64" "$MIRROR"
print_info "Running package signing..." print_info "Running package signing..."
@@ -70,11 +77,12 @@ make_dir_writable "$BUILD_OUTPUT_DIR"
# Run the signing script in Docker (always use x86_64 image) # Run the signing script in Docker (always use x86_64 image)
docker run --rm --platform linux/amd64 \ docker run --rm --platform linux/amd64 \
-e ARCH="$ARCH" \ -e ARCH="$ARCH" \
-e MIRROR="$MIRROR" \
-e GPG_PRIVATE_KEY="$GPG_PRIVATE_KEY" \ -e GPG_PRIVATE_KEY="$GPG_PRIVATE_KEY" \
-e GPG_PASSPHRASE="$GPG_PASSPHRASE" \ -e GPG_PASSPHRASE="$GPG_PASSPHRASE" \
-v "$BUILD_ROOT/build-output:/build-output" \ -v "$BUILD_ROOT/build-output:/build-output" \
-v "$BUILD_DIR:/build:ro" \ -v "$BUILD_DIR:/build:ro" \
omarchy-pkg-builder:latest-x86_64 /build/sign.sh omarchy-pkg-builder:latest-x86_64-$MIRROR /build/sign.sh
SIGN_RESULT=$? SIGN_RESULT=$?
+4 -3
View File
@@ -18,9 +18,10 @@ if [ $# -eq 0 ] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then
echo " --skip-prod-check Skip production sync confirmation" echo " --skip-prod-check Skip production sync confirmation"
echo "" echo ""
echo "Examples:" echo "Examples:"
echo " $0 pkgs.omarchy.org/x86_64 # Sync to production (with confirmation)" echo " $0 pkgs.omarchy.org/edge/x86_64 # Sync edge mirror to production (with confirmation)"
echo " $0 pkgs.omarchy.org/x86_64 --remote dev-pkgs:/ # Sync to dev remote" echo " $0 pkgs.omarchy.org/stable/x86_64 # Sync stable mirror to production"
echo " $0 pkgs.omarchy.org/x86_64 --skip-prod-check # Sync without confirmation" echo " $0 pkgs.omarchy.org/edge/x86_64 --remote dev-pkgs:/ # Sync to dev remote"
echo " $0 pkgs.omarchy.org/edge/x86_64 --skip-prod-check # Sync without confirmation"
exit 0 exit 0
fi fi
+12 -4
View File
@@ -28,14 +28,15 @@ update_database() {
make_dir_writable "$REPO_DIR" make_dir_writable "$REPO_DIR"
# Build Docker image (always use x86_64 for repo update - it's architecture independent) # Build Docker image (always use x86_64 for repo update - it's architecture independent)
build_docker_image "$BUILD_DIR" "x86_64" build_docker_image "$BUILD_DIR" "x86_64" "$MIRROR"
# Run repo-add in Docker container (always use x86_64 image) # Run repo-add in Docker container (always use x86_64 image)
docker run --rm --platform linux/amd64 \ docker run --rm --platform linux/amd64 \
-e ARCH="$ARCH" \ -e ARCH="$ARCH" \
-e MIRROR="$MIRROR" \
-v "$BUILD_ROOT/pkgs.omarchy.org:/output" \ -v "$BUILD_ROOT/pkgs.omarchy.org:/output" \
-v "$BUILD_DIR:/build:ro" \ -v "$BUILD_DIR:/build:ro" \
omarchy-pkg-builder:latest-x86_64 /build/update-repo.sh omarchy-pkg-builder:latest-x86_64-$MIRROR /build/update-repo.sh
} }
# Main execution # Main execution
@@ -50,12 +51,18 @@ main() {
update_arch_paths update_arch_paths
shift 2 shift 2
;; ;;
--mirror)
MIRROR="$2"
update_arch_paths
shift 2
;;
-h | --help) -h | --help)
echo "Usage: $0 [OPTIONS]" echo "Usage: $0 [OPTIONS]"
echo "" echo ""
echo "Options:" echo "Options:"
echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)" echo " --arch <arch> Target architecture (x86_64 or aarch64, default: x86_64)"
echo " -h, --help Show this help message" echo " --mirror <mirror> Mirror to use (edge or stable, default: edge)"
echo " -h, --help Show this help message"
exit 0 exit 0
;; ;;
*) *)
@@ -66,6 +73,7 @@ main() {
done done
print_info "Target architecture: $ARCH" print_info "Target architecture: $ARCH"
print_info "Mirror: $MIRROR"
print_info "Output directory: $REPO_DIR" print_info "Output directory: $REPO_DIR"
update_database update_database