1
0

stop-swift-ceph.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. #
  3. # SPDX-FileCopyrightText: 2015-2016 ownCloud, Inc.
  4. # SPDX-License-Identifier: AGPL-3.0-only
  5. #
  6. # This script stops the docker container the files_external tests were run
  7. # against. It will also revert the config changes done in start step.
  8. #
  9. if ! command -v docker >/dev/null 2>&1; then
  10. echo "No docker executable found - skipped docker stop"
  11. exit 0;
  12. fi
  13. echo "Docker executable found - stop and remove docker containers"
  14. # retrieve current folder to remove the config from the parent folder
  15. thisFolder=`echo $0 | replace "env/stop-swift-ceph.sh" ""`
  16. if [ -z "$thisFolder" ]; then
  17. thisFolder="."
  18. fi;
  19. # stopping and removing docker containers
  20. for container in `cat $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift`; do
  21. docker logs $container
  22. echo "Stopping and removing docker container $container"
  23. # kills running container and removes it
  24. docker stop $container
  25. docker rm -f $container
  26. done;
  27. # cleanup
  28. rm $thisFolder/config.swift.php
  29. rm $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift
  30. rm $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.swift.sock