Reorganised deployment scripts and added rollback functionality. Updated documentation and workflow for container image builds.
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -Eeuo pipefail
|
||||
|
||||
WM_DEPLOY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
# shellcheck source=common.sh
|
||||
source "$WM_DEPLOY_DIR/scripts/common.sh"
|
||||
|
||||
if [[ "$(id -u)" -ne 0 ]]; then
|
||||
wm_die "Dieses Skript muss als root ausgeführt werden."
|
||||
fi
|
||||
|
||||
wm_load_env
|
||||
revision="${1:-previous}"
|
||||
deployments_dir="$WATERMAPS_RUNTIME_DIR/deployments"
|
||||
|
||||
if [[ "$revision" == "previous" ]]; then
|
||||
images_file="$deployments_dir/previous.env"
|
||||
else
|
||||
[[ "$revision" =~ ^[0-9a-f]{40}$ ]] ||
|
||||
wm_die "Rollback-Ziel muss 'previous' oder eine vollständige Git-Commit-SHA sein."
|
||||
images_file="$deployments_dir/$revision.env"
|
||||
fi
|
||||
|
||||
[[ -f "$images_file" ]] ||
|
||||
wm_die "Gespeichertes Release nicht gefunden: $images_file"
|
||||
|
||||
exec "$WM_DEPLOY_DIR/scripts/deploy.sh" --images-file "$images_file"
|
||||
Reference in New Issue
Block a user