12 Commits
1.0.4 ... 1.0.8

Author SHA1 Message Date
hael
279c886c07 Update scripts/scheduler/entrypoint.sh
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-07-21 10:41:29 +00:00
hael
415d65ac1c Update scripts/scheduler/entrypoint.sh
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-21 08:35:09 +00:00
gyurix
6d00aefb21 Initialize JSON_TARGET variable for deployment edit action in entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-03 15:41:43 +02:00
gyurix
2c782808ed Refactor deployment logic to stop service before editing in entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-05-29 12:14:02 +02:00
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
a575bcbf46 app icon
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-29 09:43:38 +00:00
gyurix
06658b59d3 Remove installation of empty file and simplify deployment structure in entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-29 11:22:57 +02:00
2f914cf8d9 app icon
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-05-28 16:13:35 +00:00
gyurix
b362f2e37f Filter out SHARED volumes during cleanup in entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-05-26 13:23:42 +02:00
gyurix
8eb3d1eef1 Filter out USER and SYSTEM volumes during cleanup in entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-05-26 13:17:32 +02:00
gyurix
2b91706d86 Remove redundant service stop command and add cleanup for environment files in entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-05-26 12:42:43 +02:00

View File

@@ -111,8 +111,6 @@ create_htpasswd_file() {
fi fi
} }
install -m 664 -g 65534 /dev/null
deploy_additionals() { deploy_additionals() {
local DIR="$1" local DIR="$1"
@@ -208,8 +206,22 @@ remove_additionals() {
fi fi
done done
ENV_FILES=$(cat $SERVICE_DIR/service-$NAME.json | jq -r '[.containers[] | select(has("ENV_FILES")) | .ENV_FILES[]] | unique[]')
for ENV_FILE in $(echo $ENV_FILES); do
if [ -f "$ENV_FILE" ]; then
rm -rf $ENV_FILE
debug "deleted enviroment file: $ENV_FILE"
fi
done
VOLUMES=$(cat $SERVICE_DIR/service-$NAME.json | jq -r '[.containers[] | select(has("VOLUMES")) | .VOLUMES[] | select(.SHARED != "true") | .SOURCE] | unique[]' | grep -vE 'USER|SYSTEM') VOLUMES=$(cat $SERVICE_DIR/service-$NAME.json | jq -r '[.containers[] | select(has("VOLUMES")) | .VOLUMES[] | select(.SHARED != "true") | .SOURCE] | unique[]' | grep -vE 'USER|SYSTEM')
for VOLUME in $(echo $VOLUMES); do
# stop service
# force - remove stopped container, docker rm
debug "$service_exec service-$NAME.json stop force dns-remove"
$service_exec service-$NAME.json stop force dns-remove
for VOLUME in $(echo $VOLUMES | grep -vE 'USER|SYSTEM|SHARED'); do
if [ "$(echo $VOLUME | cut -d '/' -f1)" ]; then if [ "$(echo $VOLUME | cut -d '/' -f1)" ]; then
docker volume rm $VOLUME docker volume rm $VOLUME
debug "deleted volume: $VOLUME" debug "deleted volume: $VOLUME"
@@ -217,11 +229,6 @@ remove_additionals() {
fi fi
done done
# stop service
# force - remove stopped container, docker rm
debug "$service_exec service-$NAME.json stop force dns-remove"
$service_exec service-$NAME.json stop force dns-remove
# remove service files # remove service files
rm $SERVICE_DIR/*"-"$NAME.json # service, domain, etc. rm $SERVICE_DIR/*"-"$NAME.json # service, domain, etc.
@@ -791,18 +798,22 @@ execute_task() {
elif [ "$TASK_NAME" == "deployments" ]; then elif [ "$TASK_NAME" == "deployments" ]; then
DEPLOYMENTS="" DEPLOYMENTS=""
TREES=$(get_repositories) TREES=$(get_repositories)
for TREE in $TREES; do for TREE in "$TREES"; do
APPS=$(jq -rc '.apps[]' $TREE) APPS=$(jq -rc '.apps[]' $TREE)
for APP in $APPS; do #for APP in "$APPS"; do #space problem
while IFS= read -r APP; do
APP_NAME=$(echo "$APP" | jq -r '.name') APP_NAME=$(echo "$APP" | jq -r '.name')
APP_SUBTITLE="$(echo "$APP" | jq -r '.subtitle')"
APP_VERSION=$(echo "$APP" | jq -r '.version') APP_VERSION=$(echo "$APP" | jq -r '.version')
APP_ICON=$(echo "$APP" | jq -r '.icon')
if [ "$DEPLOYMENTS" != "" ]; then if [ "$DEPLOYMENTS" != "" ]; then
SEP="," SEP=","
else else
SEP="" SEP=""
fi fi
DEPLOYMENTS=$DEPLOYMENTS$SEP'"'$APP_NAME'": "'$APP_VERSION'"' DEPLOYMENTS="$DEPLOYMENTS"$SEP'"'$APP_NAME'": {"subtitle": "'"$APP_SUBTITLE"'", "version": "'"$APP_VERSION"'", "icon":
done "'"$APP_ICON"'"}'
done < <(echo "$APPS") # preserve DEPLOYMENTS variable
done done
if [ "$DEPLOYMENTS" == "" ]; then if [ "$DEPLOYMENTS" == "" ]; then
DEPLOYMENTS='"deployments": "NONE"' DEPLOYMENTS='"deployments": "NONE"'
@@ -838,6 +849,7 @@ execute_task() {
APPS=$(jq -rc '.apps[]' $TREE) APPS=$(jq -rc '.apps[]' $TREE)
for APP in $APPS; do for APP in $APPS; do
APP_NAME=$(echo "$APP" | jq -r '.name' | awk '{print tolower($0)}') APP_NAME=$(echo "$APP" | jq -r '.name' | awk '{print tolower($0)}')
APP_SUBTITLE=$(echo "$APP" | jq -r '.subtitle')
APP_VERSION=$(echo "$APP" | jq -r '.version') APP_VERSION=$(echo "$APP" | jq -r '.version')
APP_DIR=$(dirname $TREE)"/"$APP_NAME APP_DIR=$(dirname $TREE)"/"$APP_NAME
debug "$APP_TEMPLATE" debug "$APP_TEMPLATE"
@@ -891,6 +903,18 @@ 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
JSON_TARGET=""
DEPLOY_PAYLOAD=$(echo "$JSON" | jq -r .PAYLOAD) # base64 list of key-value pairs in JSON
# stop service before edit
debug "$service_exec service-$DEPLOY_NAME.json stop force"
$service_exec service-$DEPLOY_NAME.json stop force
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