mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
test(handlers): add health check to coverage build (#1684)
* test(handlers): add health check to coverage build This change ensures that the integration test container also utilises the health check script to ensure coverage for this area of code. * update health check script for coverage container * remove start period and ignore cert check
This commit is contained in:
parent
23f8a059fe
commit
ac92643212
|
@ -57,6 +57,7 @@ RUN apk --no-cache add ca-certificates tzdata
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=builder-backend /go/src/app/cmd/authelia/authelia ./
|
COPY --from=builder-backend /go/src/app/cmd/authelia/authelia ./
|
||||||
|
COPY healthcheck.sh /usr/local/bin/
|
||||||
|
|
||||||
EXPOSE 9091
|
EXPOSE 9091
|
||||||
|
|
||||||
|
@ -65,3 +66,4 @@ VOLUME /config
|
||||||
ENV PATH="/app:${PATH}"
|
ENV PATH="/app:${PATH}"
|
||||||
|
|
||||||
CMD ["authelia", "-test.coverprofile=/authelia/coverage.txt", "COVERAGE", "--config", "/config/configuration.yml"]
|
CMD ["authelia", "-test.coverprofile=/authelia/coverage.txt", "COVERAGE", "--config", "/config/configuration.yml"]
|
||||||
|
HEALTHCHECK --interval=30s --timeout=3s CMD /usr/local/bin/healthcheck.sh
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
AUTHELIA_CONFIG=$(pgrep -af authelia | awk '{print $4}')
|
AUTHELIA_CONFIG=$(pgrep -af authelia | awk '{print $NF}')
|
||||||
AUTHELIA_SCHEME=$(grep ^tls "${AUTHELIA_CONFIG}")
|
AUTHELIA_SCHEME=$(grep ^tls "${AUTHELIA_CONFIG}")
|
||||||
AUTHELIA_HOST=$(grep ^host "${AUTHELIA_CONFIG}" | sed -e 's/host: //' -e 's/\r//')
|
AUTHELIA_HOST=$(grep ^host "${AUTHELIA_CONFIG}" | sed -e 's/host: //' -e 's/\r//')
|
||||||
AUTHELIA_PORT=$(grep ^port "${AUTHELIA_CONFIG}" | sed -e 's/port: //' -e 's/\r//')
|
AUTHELIA_PORT=$(grep ^port "${AUTHELIA_CONFIG}" | sed -e 's/port: //' -e 's/\r//')
|
||||||
|
@ -20,4 +20,4 @@ if [ -z "${AUTHELIA_PORT}" ]; then
|
||||||
AUTHELIA_PORT=9091
|
AUTHELIA_PORT=9091
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wget --quiet --tries=1 --spider "${AUTHELIA_SCHEME}://${AUTHELIA_HOST}:${AUTHELIA_PORT}${AUTHELIA_PATH}/api/health" || exit 1
|
wget --quiet --no-check-certificate --tries=1 --spider "${AUTHELIA_SCHEME}://${AUTHELIA_HOST}:${AUTHELIA_PORT}${AUTHELIA_PATH}/api/health" || exit 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user