forked from oscar.krause/fastapi-dls
.gitlab-ci.yml - improved testing
This commit is contained in:
parent
701453b18a
commit
4df5f18b67
@ -65,10 +65,13 @@ test:debian:
|
||||
- job: build:debian
|
||||
artifacts: true
|
||||
before_script:
|
||||
- apt-get update -qq && apt-get install -qq -y jq # systemd
|
||||
- apt-get update -qq && apt-get install -qq -y jq
|
||||
script:
|
||||
# test installation
|
||||
- apt-get install -q -y ./build/build.deb --fix-missing
|
||||
# copy example config from GitLab-CI-Variables
|
||||
#- cat ${EXAMPLE_CONFIG} > /etc/fastapi-dls/env
|
||||
# start service in background
|
||||
- uvicorn --host 127.0.0.1 --port 443
|
||||
--app-dir /usr/share/fastapi-dls/app
|
||||
--ssl-keyfile /etc/fastapi-dls/webserver.key
|
||||
@ -76,15 +79,10 @@ test:debian:
|
||||
--proxy-headers &
|
||||
- FASTAPI_DLS_PID=$!
|
||||
- echo "Started service with pid $FASTAPI_DLS_PID"
|
||||
# testing service
|
||||
- if [ "`curl --insecure -s https://127.0.0.1/status | jq .status`" != "up" ]; then echo "Success"; else "Error"; fi
|
||||
# cleanup
|
||||
- kill $FASTAPI_DLS_PID
|
||||
# copy example config from GitLab-CI-Variables
|
||||
#- cat ${EXAMPLE_CONFIG} > /etc/fastapi-dls/env
|
||||
#- systemctl daemon-reload
|
||||
#- systemctl enable fastapi-dls.service
|
||||
#- systemctl start fastapi-dls.service
|
||||
#- if [ "`curl --insecure -s https://localhost:8000/status | jq .status`" != "up" ]; then exit 2; fi
|
||||
#- systemctl stop fastapi-dls.service
|
||||
#- systemctl disable fastapi-dls.service
|
||||
- apt-get purge -qq -y fastapi-dls
|
||||
- apt-get autoremove -qq -y && apt-get clean -qq
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user