From ab8e2b2cfb6cec7ca42eb4a04a6864bf298446c2 Mon Sep 17 00:00:00 2001 From: Andre Challier Date: Wed, 27 Mar 2024 18:27:50 +0100 Subject: [PATCH] fixed environment variable passing --- .env | 3 ++- docker-compose.yml | 3 +++ webhooks-git/entrypoint.sh | 14 ++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.env b/.env index 4b9b7ac..7209549 100644 --- a/.env +++ b/.env @@ -2,4 +2,5 @@ WEBHOOK_GIT_DATA_PATH=/path/to/webhook-git/data WEBHOOK_SECRET=1234 NGINX_NETWORK=network-name WEBHOOK_GIT_NETWORK=network-name -GIT_SERVER=git.example.com \ No newline at end of file +GIT_SERVER_PROGRAMM=git.example.com +GIT_SERVER_ASSETS=git.example.com \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 2803234..0b08fd8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,9 @@ services: - static-files:/usr/share/nginx/html networks: - nginx-network + environment: + - GIT_SERVER_ASSETS=${GIT_SERVER_ASSETS} + - GIT_SERVER_ASSETS=${GIT_SERVER_ASSETS} webhooks-git: build: diff --git a/webhooks-git/entrypoint.sh b/webhooks-git/entrypoint.sh index bec8a3b..7d0f368 100644 --- a/webhooks-git/entrypoint.sh +++ b/webhooks-git/entrypoint.sh @@ -79,17 +79,19 @@ else fi # Create or append known_hosts -ssh-keyscan -H "${GIT_SERVER_PROGRAMM}" >> "${path_ssh}/known_hosts" -ssh-keyscan -H "${GIT_SERVER_ASSETS}" >> "${path_ssh}/known_hosts" +ssh-keyscan -H "$GIT_SERVER_PROGRAMM" >> "${path_ssh}/known_hosts" +ssh-keyscan -H "$GIT_SERVER_ASSETS" >> "${path_ssh}/known_hosts" echo "git and ssh configured." -echo "Programm webhook public key (deploy key):" -echo "|------------------------------------------------------------------|" +echo "|--- Programm webhook public key (deploy key): --------------------|" cat "${path_ssh}"/programm-webhook.deploy.ed25519.pub echo "|------------------------------------------------------------------|" -echo "Assets webhook public key (deploy key):" -echo "|------------------------------------------------------------------|" +echo "|--- Assets webhook public key (deploy key): ----------------------|" cat "${path_ssh}"/assets-webhook.deploy.ed25519.pub +echo "|---- Config ------------------------------------------------------|" +cat "${path_ssh}"/config +echo "|---- known_hosts -------------------------------------------------|" +cat "${path_ssh}"/known_hosts echo "|------------------------------------------------------------------|" # Initialize assets