1
0

stop-swift-ceph.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. # @author Robin McCorkell
  10. # @copyright 2015 ownCloud
  11. if ! command -v docker >/dev/null 2>&1; then
  12. echo "No docker executable found - skipped docker stop"
  13. exit 0;
  14. fi
  15. echo "Docker executable found - stop and remove docker containers"
  16. # retrieve current folder to remove the config from the parent folder
  17. thisFolder=`echo $0 | replace "env/stop-swift-ceph.sh" ""`
  18. if [ -z "$thisFolder" ]; then
  19. thisFolder="."
  20. fi;
  21. # stopping and removing docker containers
  22. for container in `cat $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift`; do
  23. docker logs $container
  24. echo "Stopping and removing docker container $container"
  25. # kills running container and removes it
  26. docker stop $container
  27. docker rm -f $container
  28. done;
  29. # cleanup
  30. rm $thisFolder/config.swift.php
  31. rm $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
  32. rm $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift.sock