blob: bc0d8b0931b8c6c7c31297505d193bc2b54de9a1 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001#!/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
Gary Wu13111e92018-09-27 11:31:33 -070017echo "This is ${WORKSPACE}/scripts/externalapi-nbi/delete_nbi_containers.sh"
Gary Wu9abb61c2018-09-27 10:38:50 -070018
19# 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
25cd $WORKSPACE/externalapi-nbi
26
27# 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