diff --git a/.github/workflows/release-client-server-pds.yml b/.github/workflows/release-client-server-pds.yml index acae6700bc..609aa31b22 100644 --- a/.github/workflows/release-client-server-pds.yml +++ b/.github/workflows/release-client-server-pds.yml @@ -33,7 +33,7 @@ permissions: pull-requests: write env: - ACTIONS_BASE_IMAGE_ALPINE: alpine:3.17 + ACTIONS_BASE_IMAGE_ALPINE: alpine:3.20 ACTIONS_BASE_IMAGE_DEBIAN: debian:12-slim ACTIONS_SECHUB_REGISTRY: ghcr.io/mercedes-benz/sechub ACTIONS_HELM_REGISTRY: "oci://ghcr.io/mercedes-benz/sechub/helm-charts" diff --git a/.github/workflows/release-webui.yml b/.github/workflows/release-webui.yml index 7a15af7acc..164e04ffb0 100644 --- a/.github/workflows/release-webui.yml +++ b/.github/workflows/release-webui.yml @@ -21,7 +21,7 @@ permissions: pull-requests: write env: - ACTIONS_BASE_IMAGE_ALPINE: alpine:3.17 + ACTIONS_BASE_IMAGE_ALPINE: alpine:3.20 ACTIONS_BASE_IMAGE_DEBIAN: debian:12-slim ACTIONS_SECHUB_REGISTRY: ghcr.io/mercedes-benz/sechub ACTIONS_HELM_REGISTRY: "oci://ghcr.io/mercedes-benz/sechub/helm-charts" diff --git a/sechub-developertools/scripts/container/postgres/Dockerfile b/sechub-developertools/scripts/container/postgres/Dockerfile index 274c2148da..b252678ced 100644 --- a/sechub-developertools/scripts/container/postgres/Dockerfile +++ b/sechub-developertools/scripts/container/postgres/Dockerfile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT -FROM alpine:3.14 +FROM alpine:3.20 ARG DATABASE_FOLDER=/database ENV PGDATA="$DATABASE_FOLDER/data" diff --git a/sechub-pds-solutions/tern/tests/alpine/Alpine.dockerfile b/sechub-pds-solutions/tern/tests/alpine/Alpine.dockerfile index 4da19a65f4..bac52e0057 100644 --- a/sechub-pds-solutions/tern/tests/alpine/Alpine.dockerfile +++ b/sechub-pds-solutions/tern/tests/alpine/Alpine.dockerfile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT -FROM alpine:3.18 +FROM alpine:3.20 ENV DATA="/data" diff --git a/sechub-solution/10-create-image-alpine.sh b/sechub-solution/10-create-image-alpine.sh index 82a559a548..ee5abbd88e 100755 --- a/sechub-solution/10-create-image-alpine.sh +++ b/sechub-solution/10-create-image-alpine.sh @@ -16,7 +16,7 @@ usage: $0 [ with tag . Required: -- ; An Alpine based image. Example: alpine:3.17 +- ; An Alpine based image. Example: alpine:3.20 Optional: - parameter (mandatory for build type "download") See https://github.com/mercedes-benz/sechub/releases diff --git a/sechub-solution/docker-compose_sechub-alpine.yaml b/sechub-solution/docker-compose_sechub-alpine.yaml index f3d002d16a..cfb9272544 100644 --- a/sechub-solution/docker-compose_sechub-alpine.yaml +++ b/sechub-solution/docker-compose_sechub-alpine.yaml @@ -5,7 +5,7 @@ services: sechub: build: args: - - BASE_IMAGE=alpine:3.17 + - BASE_IMAGE=alpine:3.20 - BUILD_TYPE=${BUILD_TYPE} - JAVA_DISTRIBUTION=${JAVA_DISTRIBUTION} - JAVA_VERSION=${JAVA_VERSION} diff --git a/sechub-solution/docker/run.sh b/sechub-solution/docker/run.sh index 2200964d29..45ba85231c 100755 --- a/sechub-solution/docker/run.sh +++ b/sechub-solution/docker/run.sh @@ -3,12 +3,27 @@ SLEEP_TIME_IN_WAIT_LOOP="2h" +########################### +# Trap and process signals +trap trigger_shutdown INT QUIT TERM + +trigger_shutdown() +{ + if [ -n "$PID_JAVA_SERVER" ] ; then + echo "`basename $0`: Caught shutdown signal! Sending SIGTERM to Java server process $PID_JAVA_SERVER" + kill -TERM "$PID_JAVA_SERVER" + # Wait until Java server process has ended + wait "$PID_JAVA_SERVER" + fi + exit +} +########################### + check_variable() { value="$1" name="$2" - if [ -z "$value" ] - then + if [ -z "$value" ] ; then echo "Mandatory environment variable $name not set." exit 1 fi @@ -28,6 +43,13 @@ wait_loop() { done } +keep_container_alive_or_exit() { + if [ "$KEEP_CONTAINER_ALIVE_AFTER_CRASH" = "true" ] ; then + echo "[ERROR] SecHub server crashed, but keeping the container alive." + wait_loop + fi +} + init_scheduler_settings() { if [ -z "$SECHUB_CONFIG_TRIGGER_NEXTJOB_DELAY" ] ; then export SECHUB_CONFIG_TRIGGER_NEXTJOB_DELAY="10000" @@ -37,7 +59,26 @@ init_scheduler_settings() { export SECHUB_CONFIG_TRIGGER_NEXTJOB_INITIALDELAY=$(( $SECHUB_CONFIG_TRIGGER_NEXTJOB_DELAY / 10 * $(shuf -i 0-10 -n 1) )) } -localserver() { +init_s3_settings() { + # Set storage variables for Java Spring app: + check_variable "$S3_ENDPOINT" "S3_ENDPOINT" + export SECHUB_STORAGE_S3_ENDPOINT="$S3_ENDPOINT" + check_variable "$S3_BUCKETNAME" "S3_BUCKETNAME" + export SECHUB_STORAGE_S3_BUCKETNAME="$S3_BUCKETNAME" + check_variable "$S3_ACCESSKEY" "S3_ACCESSKEY" + export SECHUB_STORAGE_S3_ACCESSKEY="$S3_ACCESSKEY" + check_variable "$S3_SECRETKEY" "S3_SECRETKEY" + export SECHUB_STORAGE_S3_SECRETKEY="$S3_SECRETKEY" + + cat - <