Files
aios/scripts/init_gitops_baseline.sh
T

20 lines
841 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT="${AIOS_GITOPS_ROOT:-/data/aios-gitops}"
WORKSPACE="${AIOS_GITOPS_WORKSPACE:-$ROOT/workspace}"
ZIP_NAME="${1:-AIOS_v23_webops_owner_admin_user_PROD_DEPLOY_20260706.zip}"
mkdir -p "$ROOT/imports" "$WORKSPACE"
ZIP_PATH="$(find /data /opt /root /home -name "$ZIP_NAME" 2>/dev/null | head -1 || true)"
if [ -z "$ZIP_PATH" ]; then echo "BLOCKED: missing $ZIP_NAME"; exit 10; fi
cp "$ZIP_PATH" "$ROOT/imports/"
cd "$WORKSPACE"
unzip -o "$ROOT/imports/$ZIP_NAME"
git init
git config user.name "AIOS GitOps Bot"
git config user.email "gitops-bot@cnnetmkt.top"
git add .
git commit -m "init(baseline): import $ZIP_NAME as V1R0C0" || true
git branch -M main
git tag -a V1R0C0-baseline-20260706 -m "V1R0C0 baseline imported from $ZIP_NAME" || true
echo "BASELINE_IMPORT_OK workspace=$WORKSPACE zip=$ZIP_PATH"