Eric Debeau | bab2f61 | 2018-04-16 19:56:04 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ======================================================================== |
| 3 | # Copyright (c) 2018 Orange |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # ======================================================================== |
| 16 | |
Eric Debeau | bab2f61 | 2018-04-16 19:56:04 +0000 | [diff] [blame] | 17 | echo "This is ${WORKSPACE}/test/csit/scripts/externalapi-nbi/delete_nbi_containers.sh" |
| 18 | |
Quoc Nghia Nguyen | f1b2933 | 2018-04-17 10:54:31 +0200 | [diff] [blame] | 19 | # Check if docker-compose file exists |
| 20 | if [ ! -f "$WORKSPACE/externalapi-nbi/docker-compose.yml" ]; then |
| 21 | echo 'There is nothing to clean. Exiting...' >&2 |
| 22 | exit 0 |
| 23 | fi |
| 24 | |
Eric Debeau | bab2f61 | 2018-04-16 19:56:04 +0000 | [diff] [blame] | 25 | cd $WORKSPACE/externalapi-nbi |
| 26 | |
Quoc Nghia Nguyen | f1b2933 | 2018-04-17 10:54:31 +0200 | [diff] [blame] | 27 | # Remove containers and attached/anonymous volume(s) |
| 28 | docker-compose down -v |
| 29 | # Force stop & remove all containers and volumes |
| 30 | docker-compose rm -f -s -v |
| 31 | |
| 32 | # clean up |
| 33 | rm -rf $WORKSPACE/externalapi-nbi |