blob: 76be3289a073ee703ab5ae33a13aecc38bb644fe [file] [log] [blame]
Eric Debeaubab2f612018-04-16 19:56:04 +00001#!/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 Debeaubab2f612018-04-16 19:56:04 +000017echo "This is ${WORKSPACE}/test/csit/scripts/externalapi-nbi/delete_nbi_containers.sh"
18
Quoc Nghia Nguyenf1b29332018-04-17 10:54:31 +020019# Check if docker-compose file exists
20if [ ! -f "$WORKSPACE/externalapi-nbi/docker-compose.yml" ]; then
21 echo 'There is nothing to clean. Exiting...' >&2
22 exit 0
23fi
24
Eric Debeaubab2f612018-04-16 19:56:04 +000025cd $WORKSPACE/externalapi-nbi
26
Quoc Nghia Nguyenf1b29332018-04-17 10:54:31 +020027# Remove containers and attached/anonymous volume(s)
28docker-compose down -v
29# Force stop & remove all containers and volumes
30docker-compose rm -f -s -v
31
32# clean up
33rm -rf $WORKSPACE/externalapi-nbi