xce009 commited on
Commit
3a6a403
·
1 Parent(s): 8ee0135

deploy: auto-deploy 14:41:14

Browse files
Files changed (1) hide show
  1. deploy.py +20 -6
deploy.py CHANGED
@@ -669,13 +669,22 @@ def run_deployment(args: argparse.Namespace, env: dict[str, str]) -> int:
669
  # ──────────────────────────────────────────────
670
  print(f"\n{_bold('PHASE 2/4: Git Commit & Push')}")
671
 
672
- changed = git_status(cwd)
673
- if not changed:
674
- print(f" {_WARN_ICON} No changes to commit (working tree clean)")
675
- audit.set("commit_status", "passed")
676
- audit.set("commit_hash", "no-change")
677
- audit.set("push_status", "passed")
678
  else:
 
 
 
 
 
 
 
 
 
 
679
  print(f" {_INFO_ICON} Staging {len(changed)} file(s)...")
680
  if not git_add_all(cwd):
681
  msg = "Git add failed"
@@ -946,6 +955,11 @@ def main():
946
  action="store_true",
947
  help="Skip the backup and restore phases",
948
  )
 
 
 
 
 
949
  parser.add_argument(
950
  "--env-file",
951
  default=".env",
 
669
  # ──────────────────────────────────────────────
670
  print(f"\n{_bold('PHASE 2/4: Git Commit & Push')}")
671
 
672
+ if args.skip_git:
673
+ print(f" {_WARN_ICON} Git phase skipped (--skip-git)")
674
+ audit.set("commit_status", "skipped")
675
+ audit.set("commit_hash", "skipped")
676
+ audit.set("push_status", "skipped")
 
677
  else:
678
+ changed = git_status(cwd)
679
+ if not changed:
680
+ print(f" {_WARN_ICON} No changes to commit (working tree clean)")
681
+ print(f" {_INFO_ICON} Nothing to deploy — exiting")
682
+ audit.set("commit_status", "passed")
683
+ audit.set("commit_hash", "no-change")
684
+ audit.set("push_status", "passed")
685
+ audit.print()
686
+ return 0
687
+
688
  print(f" {_INFO_ICON} Staging {len(changed)} file(s)...")
689
  if not git_add_all(cwd):
690
  msg = "Git add failed"
 
955
  action="store_true",
956
  help="Skip the backup and restore phases",
957
  )
958
+ parser.add_argument(
959
+ "--skip-git",
960
+ action="store_true",
961
+ help="Skip the git commit and push phase",
962
+ )
963
  parser.add_argument(
964
  "--env-file",
965
  default=".env",