stop-webdav-apache.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. #
  3. # ownCloud
  4. #
  5. # This script stops the docker container the files_external tests were run
  6. # against. It will also revert the config changes done in start step.
  7. #
  8. # @author Morris Jobke
  9. # @copyright 2014 Morris Jobke <hey@morrisjobke.de>
  10. # @copyright 2016 Vincent Petry <pvince81@owncloud.com>
  11. #
  12. if ! command -v docker >/dev/null 2>&1; then
  13. echo "No docker executable found - skipped docker stop"
  14. exit 0;
  15. fi
  16. echo "Docker executable found - stop and remove docker containers"
  17. # retrieve current folder to remove the config from the parent folder
  18. thisFolder=`echo $0 | sed 's#env/stop-webdav-apache\.sh##'`
  19. if [ -z "$thisFolder" ]; then
  20. thisFolder="."
  21. fi;
  22. # stopping and removing docker containers
  23. for container in `cat $thisFolder/dockerContainerWebdav.$EXECUTOR_NUMBER.webdav`; do
  24. echo "Stopping and removing docker container $container"
  25. # kills running container and removes it
  26. docker rm -f $container
  27. done;
  28. # cleanup
  29. rm $thisFolder/config.webdav.php
  30. rm $thisFolder/dockerContainerWebdav.$EXECUTOR_NUMBER.webdav