2 Commits

Author SHA1 Message Date
gyurix
ba8af23f42 Merge branch 'main' of https://git.format.hu/safebox/framework-scheduler
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-29 12:00:27 +02:00
gyurix
c5da839c5b Add support for editing deployments in entrypoint script 2025-05-29 12:00:25 +02:00

View File

@@ -116,6 +116,7 @@ deploy_additionals() {
local DIR="$1" local DIR="$1"
local NAME="$2" local NAME="$2"
local JSON="$(echo "$3" | base64 -d)" local JSON="$(echo "$3" | base64 -d)"
local ACTION="$4"
debug "DEPLOY: $NAME" debug "DEPLOY: $NAME"
debug "JSON: $JSON" debug "JSON: $JSON"
@@ -147,6 +148,11 @@ deploy_additionals() {
done done
# start service # start service
if [ "$ACTION" == "edit" ]; then
debug "$service_exec service-$NAME.json stop force"
$service_exec service-$NAME.json stop force
fi
debug "$service_exec service-$NAME.json start info" debug "$service_exec service-$NAME.json start info"
$service_exec service-$NAME.json start info & $service_exec service-$NAME.json start info &
PID=$! PID=$!
@@ -899,6 +905,13 @@ execute_task() {
DEPLOY_PAYLOAD=$(echo "$JSON" | jq -r .PAYLOAD) # base64 list of key-value pairs in JSON DEPLOY_PAYLOAD=$(echo "$JSON" | jq -r .PAYLOAD) # base64 list of key-value pairs in JSON
deploy_additionals "$APP_DIR" "$DEPLOY_NAME" "$DEPLOY_PAYLOAD" deploy_additionals "$APP_DIR" "$DEPLOY_NAME" "$DEPLOY_PAYLOAD"
sh /scripts/check_pid.sh "$PID" "$SHARED" "deploy-$DEPLOY_NAME" "$DATE" "$DEBUG" & sh /scripts/check_pid.sh "$PID" "$SHARED" "deploy-$DEPLOY_NAME" "$DATE" "$DEBUG" &
elif [ "$DEPLOY_ACTION" == "edit" ]; then
DEPLOY_PAYLOAD=$(echo "$JSON" | jq -r .PAYLOAD) # base64 list of key-value pairs in JSON
deploy_additionals "$APP_DIR" "$DEPLOY_NAME" "$DEPLOY_PAYLOAD"
sh /scripts/check_pid.sh "$PID" "$SHARED" "deploy-$DEPLOY_NAME" "$DATE" "$DEBUG" &
elif [ "$DEPLOY_ACTION" == "uninstall" ]; then elif [ "$DEPLOY_ACTION" == "uninstall" ]; then
remove_additionals "$APP_DIR" "$DEPLOY_NAME" remove_additionals "$APP_DIR" "$DEPLOY_NAME"
# uninstall has finished # uninstall has finished