Skip to content

Commit a4cdcc1

Browse files
committed
Stop before remove
1 parent 4a4d88f commit a4cdcc1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

config.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ set -eoux pipefail
33

44
CONTAINER_NAME="osiris-hardware-ci"
55

6+
# If a running container with the same name exists, stop it.
7+
if docker ps -q -f name="^${CONTAINER_NAME}$" | grep -q .; then
8+
echo "Stopping running container ${CONTAINER_NAME}..."
9+
docker stop "${CONTAINER_NAME}" || true
10+
fi
11+
612
# If there's any container with the same name, remove it.
713
if docker ps -aq -f name="^${CONTAINER_NAME}$" | grep -q .; then
814
echo "Removing existing container ${CONTAINER_NAME}..."

0 commit comments

Comments
 (0)