updated deployment script to work with both stage and prod

This commit is contained in:
Casey 2026-02-24 16:25:58 -06:00
parent 879b95ccf8
commit ea314c73ef
2 changed files with 30 additions and 3 deletions

18
.apps_new.stage.json Normal file
View File

@ -0,0 +1,18 @@
[
{
"url": "https://github.com/frappe/erpnext",
"branch": "version-15"
},
{
"url": "https://github.com/frappe/hrms",
"branch": "version-15"
},
{
"url": "https://github.com/frappe/payments",
"branch": "version-15"
},
{
"url": "https://git.ben-nilsen.com/bnilsen/custom_ui.git",
"branch": "development"
}
]

View File

@ -1,11 +1,13 @@
#!/bin/bash
set -e
TAG=""
REMOTE_HOST="erpnext.lasthourhosting.org"
REMOTE_USER="root"
REMOTE_HOST="erp.stage.sprinklersnorthwest.com"
REMOTE_USER="lasthour"
MIGRATE=false
BUILD_ONLY=false
ALREADY_EXISTING=false
PROD_DEPLOYMENT=false
APPS_JSON_FILE="./apps_new.stage.json"
while [[ $# -gt 0 ]]; do
case "$1" in
@ -22,6 +24,12 @@ while [[ $# -gt 0 ]]; do
MIGRATE=true
shift 1
;;
--prod)
PROD_DEPLOYMENT=true
REMOTE_HOST="erp.sprinklersnorthwest.com"
APPS_JSON_FILE="./apps_new.json"
shift 1
;;
--remote-host)
if [[ -z "${2:-}" ]]; then
echo "Error: --remote-host requires a value"
@ -63,6 +71,7 @@ while [[ $# -gt 0 ]]; do
echo "Options:"
echo " --tag <string> REQUIRED. Version tag for the image (e.g., 1.0.0)."
echo " --migrate Run 'bench migrate' on the remote server."
echo " --prod Deploy to production server (overrides --remote-host)."
echo " --build-only Build and push only; skip remote deployment checks & action."
echo " --remote-host <host> Target server (Default: $REMOTE_HOST)."
echo " --remote-user <user> SSH User (Default: $REMOTE_USER)."
@ -158,7 +167,7 @@ if [ "$ALREADY_EXISTING" = true ]; then
exit 1
fi
export TAG
export APPS_JSON_BASE64=$(base64 -w 0 ./apps_new.json)
export APPS_JSON_BASE64=$(base64 -w 0 "$APPS_JSON_FILE")
echo "Building Brotherton Frappe Docker Image with tag: $TAG"
echo "APPS_JSON_BASE64: $APPS_JSON_BASE64"
echo "🚀 Starting Docker build..."