Improve studio artwork media revisions
This commit is contained in:
@@ -12,6 +12,7 @@ composer_bin="${COMPOSER_BIN:-composer}"
|
||||
ssh_bin="${SSH_BIN:-ssh}"
|
||||
rsync_bin="${RSYNC_BIN:-rsync}"
|
||||
local_build_command="${LOCAL_BUILD_COMMAND:-}"
|
||||
allow_deploy_from_dot_deploy="${ALLOW_DEPLOY_FROM_DOT_DEPLOY:-0}"
|
||||
|
||||
run_local_build=1
|
||||
run_remote_migrations=1
|
||||
@@ -59,10 +60,34 @@ Options:
|
||||
Environment overrides:
|
||||
LOCAL_FOLDER, REMOTE_FOLDER, REMOTE_SERVER, PHP_BIN, COMPOSER_BIN, SSH_BIN, RSYNC_BIN,
|
||||
LOCAL_BUILD_COMMAND, DB_SYNC_CONFIRM_TARGET, DB_SYNC_CONFIRM_PHRASE,
|
||||
ALLOW_DEPLOY_FROM_DOT_DEPLOY,
|
||||
FULL_UPGRADE_PRE_HOOK, FULL_UPGRADE_POST_HOOK
|
||||
EOF
|
||||
}
|
||||
|
||||
guard_local_folder() {
|
||||
local normalized_local_folder
|
||||
|
||||
normalized_local_folder="$(cd -- "$local_folder" && pwd)"
|
||||
local_folder="$normalized_local_folder"
|
||||
|
||||
echo "Deploy source: $local_folder"
|
||||
echo "Deploy target: $remote_server:$remote_folder"
|
||||
|
||||
if [[ ! -d "$local_folder" ]]; then
|
||||
echo "Deploy source folder does not exist: $local_folder" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$allow_deploy_from_dot_deploy" != "1" && "$local_folder" == *"/.deploy/"* ]]; then
|
||||
echo "Refusing to deploy from a .deploy snapshot folder: $local_folder" >&2
|
||||
echo "This usually means LOCAL_FOLDER is pointing at a stale release snapshot instead of the repo root." >&2
|
||||
echo "Unset LOCAL_FOLDER or set it to the repository root before running sync.sh." >&2
|
||||
echo "If you intentionally want to deploy from that folder, set ALLOW_DEPLOY_FROM_DOT_DEPLOY=1." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
set_deploy_mode() {
|
||||
case "$1" in
|
||||
normal|full-upgrade)
|
||||
@@ -335,6 +360,8 @@ if [[ -n "$full_upgrade_pre_hook" || -n "$full_upgrade_post_hook" ]] && [[ "$dep
|
||||
exit 1
|
||||
fi
|
||||
|
||||
guard_local_folder
|
||||
|
||||
if [[ "$run_db_sync" -eq 1 && "$db_sync_source" != "local" ]]; then
|
||||
echo "Refusing DB sync without an explicit source. Use --with-db-from=local." >&2
|
||||
exit 1
|
||||
@@ -465,8 +492,10 @@ if [[ "$RUN_REMOTE_MIGRATIONS" -eq 1 ]]; then
|
||||
"$PHP_BIN" artisan migrate --force
|
||||
fi
|
||||
|
||||
"$PHP_BIN" artisan view:clear
|
||||
"$PHP_BIN" artisan optimize:clear
|
||||
"$PHP_BIN" artisan optimize
|
||||
"$PHP_BIN" artisan view:cache
|
||||
|
||||
if [[ "$SKIP_MAINTENANCE" -eq 0 ]]; then
|
||||
"$PHP_BIN" artisan up
|
||||
|
||||
Reference in New Issue
Block a user