stop-amazons3-ceph.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env 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-amazons3-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.amazons3`; do
  21. echo "Stopping and removing docker container $container"
  22. # kills running container and removes it
  23. docker stop $container
  24. docker rm -f $container
  25. done;
  26. # cleanup
  27. rm $thisFolder/config.amazons3.php
  28. rm $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.amazons3
  29. rm $thisFolder/dockerContainerCeph.$EXECUTOR_NUMBER.amazons3.sock