/ scripts / commit-ci-updates.sh
commit-ci-updates.sh
 1  #!/bin/bash
 2  # Commit and push CI updates to all repos
 3  # Run on CI server: bash scripts/commit-ci-updates.sh
 4  
 5  set -euo pipefail
 6  
 7  WORKSPACE="/home/devops/working-repos"
 8  
 9  # Define repo lists
10  RUST_REPOS="alphavm deltavm adnet alphaos deltaos acdc-core ac-dc adl wallet-core"
11  FRONTEND_TS_REPOS="acdc-wallet acdc-governor acdc-messenger acdc-scanner acdc-docs acdc-home acdc-forge"
12  FRONTEND_DESIGN_REPOS="acdc-design acdc-i18n"
13  ALL_REPOS="$RUST_REPOS $FRONTEND_TS_REPOS $FRONTEND_DESIGN_REPOS ci-dashboard"
14  
15  COMMIT_MSG="chore(ci): add nightly quality gates and pre-commit hooks
16  
17  - Add nightly.yml for mutation testing (6:00 UTC)
18  - Add dead-code.yml for dead code cleanup (4:00 UTC)
19  - Add deny.toml for license compliance (Rust only)
20  - Add .pre-commit-config.yaml for local hooks
21  
22  Part of CI pipeline optimization initiative.
23  
24  Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>"
25  
26  echo "=== Committing and pushing CI updates ==="
27  
28  for repo in $ALL_REPOS; do
29      REPO_PATH="$WORKSPACE/$repo"
30      if [ -d "$REPO_PATH" ]; then
31          echo ""
32          echo "=== Processing $repo ==="
33          cd "$REPO_PATH"
34  
35          # Check if there are changes
36          if [ -n "$(git status --porcelain)" ]; then
37              echo "Changes detected, committing..."
38  
39              # Stage new/modified files
40              git add -A
41  
42              # Show what's being committed
43              git status --short
44  
45              # Commit
46              git commit -m "$COMMIT_MSG" || echo "Nothing to commit"
47  
48              # Push
49              git push origin main || git push origin master || echo "Push failed for $repo"
50          else
51              echo "No changes in $repo"
52          fi
53      else
54          echo "Skipping $repo (not found)"
55      fi
56  done
57  
58  echo ""
59  echo "=== Done ==="
60  echo "All repos processed. Check CI dashboard for workflow status."