refactor: add seperate entrypoint for plugin init

This commit is contained in:
devydave
2026-07-03 13:10:52 +02:00
parent 536d958468
commit d79d4ab12d
4 changed files with 25 additions and 10 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
export TRAEFIK_YML_VERSION=v32
export FILE_PROVIDER_YML_VERSION=v13
export ENTRYPOINT_VERSION=v6
export ENTRYPOINT_VERSION=v7
export IOCAINE_ENTRYPOINT_VERSION=v1
+7
View File
@@ -27,6 +27,9 @@ services:
- source: entrypoint
target: /custom-entrypoint.sh
mode: 0555
- source: iocaine_entrypoint
target: /entrypoint.iocaine.sh
mode: 0555
networks:
- proxy
- internal
@@ -115,6 +118,10 @@ configs:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
iocaine_entrypoint:
name: ${STACK_NAME}_entrypoint_${IOCAINE_ENTRYPOINT_VERSION}
file: entrypoint.iocaine.sh.tmpl
template_driver: golang
volumes:
letsencrypt:
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
set -e
apk --no-cache add git go
iocaine_path="/plugins-local/src/git.mstar.dev/mstar/traefik-iocaine-middleware"
if [ ! -d "$iocaine_path" ]; then
git clone --depth 1 --branch $IOCAINE_PLUGIN_VERSION https://git.mstar.dev/mstar/traefik-iocaine-middleware.git $iocaine_path
else
git -C $iocaine_path fetch origin 'refs/tags/*:refs/tags/*'
git -C $iocaine_path checkout tags/$IOCAINE_PLUGIN_VERSION
fi
(cd $iocaine_path && go mod vendor)
exit 0
+1 -9
View File
@@ -16,15 +16,7 @@ export AZURE_CLIENT_SECRET=$(cat "$AZURE_CLIENT_SECRET_FILE")
{{ end }}
{{ if eq (env "IOCAINE_ENABLE") "1" }}
apk --no-cache add git go
iocaine_path="/plugins-local/src/git.mstar.dev/mstar/traefik-iocaine-middleware"
if [ ! -d "$iocaine_path" ]; then
git clone --depth 1 --branch $IOCAINE_PLUGIN_VERSION https://git.mstar.dev/mstar/traefik-iocaine-middleware.git $iocaine_path
else
git -C $iocaine_path fetch origin 'refs/tags/*:refs/tags/*'
git -C $iocaine_path checkout tags/$IOCAINE_PLUGIN_VERSION
fi
(cd $iocaine_path && go mod vendor)
/entrypoint.iocaine.sh
{{ end }}
/entrypoint.sh "$@"