Created
May 7, 2026 14:07
-
-
Save maxfenton/667529e54d27c6b3588905b2bcca2c59 to your computer and use it in GitHub Desktop.
bin/push-accounts-to-staging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Push local Panel accounts to staging. | |
| # Defaults to dry run — shows what would change without touching the server. | |
| # | |
| # Usage: | |
| # bin/push-accounts-to-staging — dry run | |
| # bin/push-accounts-to-staging --real — execute | |
| set -euo pipefail | |
| PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)" | |
| if [ -f "$PROJECT_ROOT/.env" ]; then | |
| source "$PROJECT_ROOT/.env" | |
| fi | |
| : "${DEPLOY_USER:?DEPLOY_USER not set — add to .env}" | |
| : "${DEPLOY_HOST:?DEPLOY_HOST not set — add to .env}" | |
| : "${STAGING_PATH:?STAGING_PATH not set — add to .env}" | |
| if [[ "${1:-}" != "--real" ]]; then | |
| echo "DRY RUN — showing what would be pushed to staging (no changes made):" | |
| echo "" | |
| rsync -rlptzv --delete --dry-run \ | |
| "$PROJECT_ROOT/storage/accounts/" \ | |
| "$DEPLOY_USER@$DEPLOY_HOST:$STAGING_PATH/storage/accounts/" | |
| echo "" | |
| echo "Run with --real to push these changes to staging." | |
| exit 0 | |
| fi | |
| echo "Pushing accounts to staging..." | |
| rsync -rlptzv --delete \ | |
| "$PROJECT_ROOT/storage/accounts/" \ | |
| "$DEPLOY_USER@$DEPLOY_HOST:$STAGING_PATH/storage/accounts/" | |
| echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment