From e3371457f3bde0d28447052c1a285cff4fc7259e Mon Sep 17 00:00:00 2001 From: hael Date: Mon, 3 Mar 2025 17:11:06 +0100 Subject: [PATCH 1/5] SETUP_VERSION --- scripts/check_certificates.sh | 13 +++---------- scripts/check_proxy_state.sh | 3 ++- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/scripts/check_certificates.sh b/scripts/check_certificates.sh index 300e5c3..1cf3db0 100755 --- a/scripts/check_certificates.sh +++ b/scripts/check_certificates.sh @@ -14,17 +14,9 @@ TIMEOUT=$TIMEOUT RESTART=$RESTART -# Setup docker registry url path - -if [[ -n "$DOCKER_REGISTRY_URL" && "$DOCKER_REGISTRY_URL" != "null" ]] ; then - SETUP="/setup"; -else - SETUP="setup"; - DOCKER_REGISTRY_URL=""; -fi +SETUP_VERSION=${SETUP_VERSION:-latest}; # Setting service files path - if [ "$SERVICE_FILES" == "" ]; then SERVICE_FILES=/etc/user/config/services fi @@ -33,6 +25,7 @@ if [ "$SOURCE" == "" ]; then SOURCE=/etc/user/config fi +# Setup docker registry url path if [[ -n "$DOCKER_REGISTRY_URL" && "$DOCKER_REGISTRY_URL" != "null" ]] ; then SETUP="/setup"; else @@ -49,7 +42,7 @@ service_exec="docker run --rm \ --mount src=USER_CONFIG,dst=/etc/user/config/user.json,volume-subpath=user.json,ro \ -v /var/run/docker.sock:/var/run/docker.sock \ --env DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL \ -$DOCKER_REGISTRY_URL$SETUP" +$DOCKER_REGISTRY_URL$SETUP:$SETUP_VERSION" letsencrypt_certificates() { diff --git a/scripts/check_proxy_state.sh b/scripts/check_proxy_state.sh index d933314..ccc7239 100755 --- a/scripts/check_proxy_state.sh +++ b/scripts/check_proxy_state.sh @@ -20,6 +20,7 @@ ROLE=$ROLE SERVICE_NAME=$SERVICE_NAME PROXY_CONFIG_DIR=$PROXY_CONFIG_DIR +SETUP_VERSION=${SETUP_VERSION:-latest}; # Setup docker registry url path @@ -77,7 +78,7 @@ service_exec="docker run --rm \ -v /etc/user/config/services/tmp/:/services/tmp/:rw \ -v /var/run/docker.sock:/var/run/docker.sock \ --env DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL \ - $DOCKER_REGISTRY_URL$SETUP" + $DOCKER_REGISTRY_URL$SETUP:$SETUP_VERSION" do_proxy_restart() { From f4f696ccd6ae46d006b5c6f9032fd920f825a091 Mon Sep 17 00:00:00 2001 From: Gyurix Date: Mon, 3 Mar 2025 17:16:48 +0100 Subject: [PATCH 2/5] VOLUME_MOUNTS --- scripts/check_certificates.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/check_certificates.sh b/scripts/check_certificates.sh index 1cf3db0..4afdb26 100755 --- a/scripts/check_certificates.sh +++ b/scripts/check_certificates.sh @@ -33,13 +33,28 @@ else DOCKER_REGISTRY_URL=""; fi -service_exec="docker run --rm \ --w /services/ \ +if [ "$SETUP_VERSION" == "latest" ]; then + VOLUME_MOUNTS=" --mount src=SYSTEM_DATA,dst=/etc/ssl/certs,volume-subpath=ssl/certs,ro \ --mount src=SYSTEM_DATA,dst=/etc/dns/hosts.local,volume-subpath=dns/hosts.local,ro \ --mount src=USER_CONFIG,dst=/services,volume-subpath=services/tmp \ --mount src=USER_CONFIG,dst=/etc/user/config/system.json,volume-subpath=system.json,ro \ --mount src=USER_CONFIG,dst=/etc/user/config/user.json,volume-subpath=user.json,ro \ +"; +else + VOLUME_MOUNTS=" + -v /etc/system/data/dns:/etc/dns:rw \ + -v /etc/ssl/certs:/etc/ssl/certs:ro \ + -v /etc/user/config/user.json:/etc/user/config/user.json:ro \ + -v /etc/user/config/system.json:/etc/user/config/system.json:ro \ + -v /etc/user/config/services/:/services/:ro \ + -v /etc/user/config/services/tmp:/services/tmp:rw \ +" +fi; + +service_exec="docker run --rm \ +-w /services/ \ +$VOLUME_MOUNTS -v /var/run/docker.sock:/var/run/docker.sock \ --env DOCKER_REGISTRY_URL=$DOCKER_REGISTRY_URL \ $DOCKER_REGISTRY_URL$SETUP:$SETUP_VERSION" From 435237009ad4ef7d4390ea0d9dcca743f9ec7b38 Mon Sep 17 00:00:00 2001 From: Gyorgy Berenyi Date: Wed, 5 Mar 2025 10:41:16 +0000 Subject: [PATCH 3/5] add drone.yml --- .drone.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..5366595 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,47 @@ +kind: pipeline +type: kubernetes +name: default + +node_selector: + physical-node: dev2 + +trigger: + branch: + - main + event: + - push +workspace: + path: /drone/src + +steps: + - name: build multiarch proxy-scheduler + image: docker.io/owncloudci/drone-docker-buildx:4 + privileged: true + settings: + cache-from: [ "registry.dev.format.hu/proxy-scheduler" ] + registry: registry.dev.format.hu + repo: registry.dev.format.hu/proxy-scheduler + tags: latest + dockerfile: Dockerfile + username: + from_secret: dev-hu-registry-username + password: + from_secret: dev-hu-registry-password + platforms: + - linux/amd64 + - linux/arm64 + + - name: pull image to dockerhub + image: docker.io/owncloudci/drone-docker-buildx:4 + privileged: true + settings: + cache-from: [ "safebox/proxy-scheduler" ] + repo: safebox/proxy-scheduler + tags: latest + username: + from_secret: dockerhub-username + password: + from_secret: dockerhub-password + platforms: + - linux/amd64 + - linux/arm64 \ No newline at end of file From e443266f7543df72c4be3036aafe4a9568c9fa70 Mon Sep 17 00:00:00 2001 From: Gyorgy Berenyi Date: Wed, 5 Mar 2025 10:41:59 +0000 Subject: [PATCH 4/5] Update .drone.yml --- .drone.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 5366595..7828a85 100644 --- a/.drone.yml +++ b/.drone.yml @@ -44,4 +44,5 @@ steps: from_secret: dockerhub-password platforms: - linux/amd64 - - linux/arm64 \ No newline at end of file + - linux/arm64 + \ No newline at end of file From 86d57693f6579deda8b04613ed5cd17b155aca31 Mon Sep 17 00:00:00 2001 From: Gyorgy Berenyi Date: Wed, 5 Mar 2025 10:42:38 +0000 Subject: [PATCH 5/5] Update .drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 7828a85..1781861 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,7 +7,7 @@ node_selector: trigger: branch: - - main + - master event: - push workspace: