16 Commits
1.1.1 ... 1.1.2

Author SHA1 Message Date
e40b900750 Update scripts/scheduler/entrypoint.sh
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-08-08 09:43:21 +00:00
ae83abef53 upgrade STATUS
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-08 09:35:12 +00:00
0e05eaa531 version fix
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-08 09:01:06 +00:00
gyurix
8c345020f7 Refactor debug mode handling in entrypoint script for improved clarity
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 16:48:26 +02:00
gyurix
10a6bc704c Enhance entrypoint script with debug mode and Docker registry environment variables
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 16:45:46 +02:00
gyurix
ba921a53a2 Log the Docker run command in the entrypoint script for debugging purposes
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 16:38:25 +02:00
gyurix
7bb96a1863 Add support for Docker registry credentials in entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 16:27:39 +02:00
gyurix
d0f65b8841 Add Docker registry login functionality to entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 16:22:57 +02:00
gyurix
72e14d7199 Check for the existence of JSON file before creating it in add_json_target function
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 16:08:55 +02:00
gyurix
566aed3752 Prevent overwriting existing JSON files in add_json_target function
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 16:06:41 +02:00
3ab1b3ff54 do not create upgrade.json
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 13:49:40 +00:00
dafd8f345a git pull log
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 13:35:52 +00:00
gyurix
56e2f6f05d Silence output of git pull in entrypoint script to reduce log clutter
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 15:28:26 +02:00
gyurix
e343bc2cb5 Enhance entrypoint script to log completion of git pull operation
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 15:07:53 +02:00
gyurix
6d267dfd04 Merge branch 'main' of https://git.format.hu/safebox/framework-scheduler
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-07 13:21:42 +02:00
gyurix
b049833844 Add logging for git pull operation in entrypoint script 2025-08-07 13:21:40 +02:00

View File

@@ -2,10 +2,24 @@
cd /scripts
DEBUG_MODE=${DEBUG_MODE:-false}
VERSION=1.1.1
VERSION="1.1.1"
#DOCKER_REGISTRY_URL=${DOCKER_REGISTRY_URL:-registry.format.hu}
DOCKER_REGISTRY_URL=${DOCKER_REGISTRY_URL:-safebox}
DOCKER_REGISTRY_USERNAME=$DOCKER_REGISTRY_USERNAME
DOCKER_REGISTRY_PASSWORD=$DOCKER_REGISTRY_PASSWORD
if [ -n "$DOCKER_REGISTRY_USERNAME" ] && [ -n "$DOCKER_REGISTRY_PASSWORD" ]; then
echo "Logging in to Docker registry $DOCKER_REGISTRY_URL"
echo "$DOCKER_REGISTRY_PASSWORD" | docker login $DOCKER_REGISTRY_URL --username $DOCKER_REGISTRY_USERNAME --password-stdin
DOCKER_REGISTRY_ENVS="--env DOCKER_REGISTRY_USERNAME=$DOCKER_REGISTRY_USERNAME --env DOCKER_REGISTRY_PASSWORD=$DOCKER_REGISTRY_PASSWORD"
else
echo "No Docker registry credentials provided, skipping login."
fi
USER_INIT_PATH=$USER_INIT_PATH
GLOBAL_VERSION=${GLOBAL_VERSION:-latest}
SERVICE_DIR=${SERVICE_DIR:-/etc/user/config/services}
@@ -20,6 +34,14 @@ FRAMEWORK_SCHEDULER_NETWORK_SUBNET=${FRAMEWORK_SCHEDULER_NETWORK_SUBNET:-"172.19
FRAMEWORK_SCHEDULER_VERSION=${FRAMEWORK_SCHEDULER_VERSION:-latest}
RUN_FORCE=${RUN_FORCE:-false}
if [ "$DEBUG_MODE" == "true" ]; then
DOCKER_START="--entrypoint=sh $DOCKER_REGISTRY_URL/$FRAMEWORK_SCHEDULER_IMAGE:$FRAMEWORK_SCHEDULER_VERSION -c 'sleep 86400'"
SET_DEBUG_MODE="--env DEBUG_MODE=true"
else
DOCKER_START="$DOCKER_REGISTRY_URL/$FRAMEWORK_SCHEDULER_IMAGE:$FRAMEWORK_SCHEDULER_VERSION"
SET_DEBUG_MODE=""
fi
WEB_SERVER=${WEB_SERVER:-webserver}
WEB_IMAGE=${WEB_IMAGE:-web-installer}
WEBSERVER_PORT=${WEBSERVER_PORT:-8080}
@@ -81,6 +103,8 @@ $VOLUME_MOUNTS \
--env SETUP_VERSION=$SETUP_VERSION \
--env GLOBAL_VERSION=$GLOBAL_VERSION \
--env HOST_FILE=$HOST_FILE \
$SET_DEBUG_MODE \
$DOCKER_REGISTRY_ENVS \
$DOCKER_REGISTRY_URL$SETUP:$SETUP_VERSION"
DEBUG=1
@@ -99,8 +123,10 @@ add_json_target(){
if [ -n "$TASK_NAME" ]; then
TASK="upgrade-$TASK_NAME"
fi
install -m 664 -g 65534 /dev/null $SHARED/output/$TASK.json
if [ ! -f $SHARED/output/$TASK.json ]; then
install -m 664 -g 65534 /dev/null $SHARED/output/$TASK.json
fi
echo $JSON_TARGET | base64 -d >$SHARED/output/$TASK.json
}
@@ -522,7 +548,8 @@ get_repositories() {
GIT_HTTP_CONNECT_TIMEOUT=10 GIT_HTTP_TIMEOUT=30 git clone $REPO /tmp/$BASE >/dev/null
else
cd /tmp/$BASE
GIT_HTTP_CONNECT_TIMEOUT=10 GIT_HTTP_TIMEOUT=30 git pull >/dev/null
date >> /tmp/pull.log
GIT_HTTP_CONNECT_TIMEOUT=10 GIT_HTTP_TIMEOUT=30 git pull >> /tmp/pull.log
fi
if [ -f "/tmp/$BASE/applications-tree.json" ]; then
TREES=$TREES" /tmp/$BASE/applications-tree.json"
@@ -866,14 +893,6 @@ upgrade_scheduler() {
debug "Upgrading framework scheduler..."
/usr/bin/docker pull "$DOCKER_REGISTRY_URL/$FRAMEWORK_SCHEDULER_IMAGE:$FRAMEWORK_SCHEDULER_VERSION"
if [ "$DEBUG_MODE" == "true" ]; then
DOCKER_START="--entrypoint=sh $DOCKER_REGISTRY_URL/$FRAMEWORK_SCHEDULER_IMAGE:$FRAMEWORK_SCHEDULER_VERSION -c 'sleep 86400'"
SET_DEBUG_MODE="--env DEBUG_MODE=true"
else
DOCKER_START="$DOCKER_REGISTRY_URL/$FRAMEWORK_SCHEDULER_IMAGE:$FRAMEWORK_SCHEDULER_VERSION"
SET_DEBUG_MODE=""
fi
FRAMEWORK_SCHEDULER_NAME="$FRAMEWORK_SCHEDULER_NAME-$(head /dev/urandom | tr -dc '0-9' | head -c 6)"
DOCKER_RUN="/usr/bin/docker run -d \
@@ -887,12 +906,14 @@ upgrade_scheduler() {
-v USER_SECRET:/etc/user/secret \
--restart=always \
--name $FRAMEWORK_SCHEDULER_NAME \
$DOCKER_REGISTRY_ENVS \
$SET_DEBUG_MODE \
--env WEBSERVER_PORT=$WEBSERVER_PORT \
--network $FRAMEWORK_SCHEDULER_NETWORK \
--env RUN_FORCE=$RUN_FORCE \
--env DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL \
$DOCKER_START"
echo "DOCKER RUN: $DOCKER_RUN"
eval "$DOCKER_RUN"
}
@@ -1343,7 +1364,7 @@ execute_task() {
JSON="$(echo $B64_JSON | base64 -d)"
NAME=$(echo "$JSON" | jq -r .NAME | awk '{print tolower($0)}')
if [ "$NAME" == "framework" ]; then
JSON_TARGET=$(echo '{"DATE":"'$DATE'","INSTALL_STATUS":0}' | jq -r . | base64 -w0)
JSON_TARGET=$(echo '{"DATE":"'$DATE'","STATUS":1}' | jq -r . | base64 -w0)
add_json_target $NAME
echo "Upgrading service: webserver"
upgrade webserver
@@ -1356,11 +1377,13 @@ execute_task() {
upgrade_scheduler
echo "Removing old framework scheduler container..."
JSON_TARGET=$(echo '{"DATE":"'$DATE'","INSTALL_STATUS":1,"VERSION":'$VERSION'}' | jq -r . | base64 -w0)
JSON_TARGET=$(echo '{"DATE":"'$DATE'","STATUS":2,"VERSION":"'$VERSION'"}' | jq -r . | base64 -w0)
add_json_target $NAME
sleep 1
/usr/bin/docker rm -f $HOSTNAME
JSON_TARGET="" # do not create upgrade.json
#CONTAINERS=$(docker ps -a --format '{{.Names}} {{.Status}}' | grep -E 'framework-scheduler|webserver')
else
echo "Upgrading service: $NAME"