Mercurial
comparison bundle_push_to_git.sh @ 15:2b9e75756825
[GuiZe] Updated to handle bundling and created a shee
l script for pushing.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Fri, 03 Oct 2025 06:50:33 -0700 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 14:0570ada19343 | 15:2b9e75756825 |
|---|---|
| 1 #!/usr/bin/env bash | |
| 2 set -euo pipefail | |
| 3 | |
| 4 # Usage: ./deploy.sh <project_name> <bundle_path> | |
| 5 if [ $# -ne 2 ]; then | |
| 6 echo "Usage: $0 <project_name> <bundle_path>" | |
| 7 exit 1 | |
| 8 fi | |
| 9 | |
| 10 PROJECT_NAME="$1" | |
| 11 BUNDLE_PATH="$2" | |
| 12 | |
| 13 SRC=$BUNDLE_PATH | |
| 14 DEST="projects/$PROJECT_NAME" | |
| 15 | |
| 16 echo $BUNDLE_PATH $DEST | |
| 17 | |
| 18 mkdir -p "$DEST" | |
| 19 # Force write copy as I write this. | |
| 20 rsync -a --delete \ | |
| 21 --exclude='.git/' \ | |
| 22 --exclude='.gitignore' \ | |
| 23 --chmod=Du+rwx,Fu+rw \ | |
| 24 "$SRC"/ "$DEST"/ | |
| 25 | |
| 26 pushd "$DEST" > /dev/null | |
| 27 if [ ! -d .git ]; then | |
| 28 git init | |
| 29 [ -f .gitignore ] || touch .gitignore | |
| 30 git add . | |
| 31 git commit -m "Initial import of mrjunejune_server_bundle" | |
| 32 else | |
| 33 git add -A | |
| 34 git commit -m "Update bundle @ $(date -u +"%Y-%m-%dT%H:%M:%SZ")" | |
| 35 fi | |
| 36 | |
| 37 popd > /dev/null | |
| 38 | |
| 39 echo "✅ Deployed to $DEST (git repo initialized: $( [ -d "$DEST/.git" ] && echo yes || echo no ))" |