From c3569d9bd003eb5bae4059d9a569c673a86d1577 Mon Sep 17 00:00:00 2001 From: Clement Michaud Date: Mon, 9 Dec 2019 07:38:20 +0100 Subject: [PATCH] Use static version of Authelia in suites when in CI. This is to avoid the multiple reloads due to the frontend modules being installed at the startup of the suite and randomly preventing Authelia from starting. --- bootstrap.sh | 1 + .../compose/authelia/docker-compose.backend.yml | 1 + .../compose/authelia/resources/entrypoint.sh | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 7b92a0cc9..b757b62f4 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -9,6 +9,7 @@ fi export USER_ID=$(id -u) export GROUP_ID=$(id -g) +export CI=false echo "[BOOTSTRAP] Checking if Go is installed..." diff --git a/example/compose/authelia/docker-compose.backend.yml b/example/compose/authelia/docker-compose.backend.yml index 2b9bf9ed0..28a0d18c1 100644 --- a/example/compose/authelia/docker-compose.backend.yml +++ b/example/compose/authelia/docker-compose.backend.yml @@ -15,6 +15,7 @@ services: - "${GOPATH}:/go" environment: - ENVIRONMENT=dev + - CI=${CI} networks: authelianet: ipv4_address: 192.168.240.50 diff --git a/example/compose/authelia/resources/entrypoint.sh b/example/compose/authelia/resources/entrypoint.sh index e5aceee14..547d3525e 100755 --- a/example/compose/authelia/resources/entrypoint.sh +++ b/example/compose/authelia/resources/entrypoint.sh @@ -2,10 +2,17 @@ set -x -go get github.com/cespare/reflex +if [ "$CI" == "true" ]; +then + echo "Use static version of Authelia" + /resources/run.sh +else + echo "Use hot reloaded version of Authelia" + go get github.com/cespare/reflex -# Sleep 10 seconds to wait the end of npm install updating web directory -# and making reflex reload multiple times. -sleep 10 + # Sleep 10 seconds to wait the end of npm install updating web directory + # and making reflex reload multiple times. + sleep 10 -reflex -c /resources/reflex.conf + reflex -c /resources/reflex.conf +fi