diff --git a/templates/usr/local/bin/authentik-backup.sh.j2 b/templates/usr/local/bin/authentik-backup.sh.j2 index 2773659..32ea293 100644 --- a/templates/usr/local/bin/authentik-backup.sh.j2 +++ b/templates/usr/local/bin/authentik-backup.sh.j2 @@ -28,4 +28,30 @@ docker exec -i $POSTGRES_DOCKER_ID /usr/local/bin/dropdb --username {{ authentik docker exec -i $POSTGRES_DOCKER_ID /usr/local/bin/createdb --username {{ authentik_db.user }} '{{ authentik_db.name }}' docker exec -i $POSTGRES_DOCKER_ID /usr/local/bin/psql --username {{ authentik_db.user }} -d {{ authentik_db.name }} < $TARGETFOLDER/authentik-postgres-backup.sql docker-compose down -docker-compose up -d \ No newline at end of file +docker-compose up -d + + +( + flock -n 9 || { + echo "PERFORMANCE TEST ABORTED! ALREADY RUNNING!"; + exit 1; + } + + if [[ $(id -u) != 0 ]]; then + echo "Performance test aborted; please become root in order to run a performance test."; + exit 1; + fi + + case $tooling in + "atlassian") + echo "blah"; + ;; + *) + # I know this looks stupid, only one case, but in future we want to use TaaS/TReX aswell... + # So let's make it future safe! + echo -e "Invalid tooling '$tooling'.Please check help for correct list." + exit 1 + ;; + esac + echo "" +) 9>/var/run/lock/devstack-loadtest.lock; \ No newline at end of file