
Prune minikube volumes in addition to orphans & build cache. Closes-Bug: 2020807 Signed-off-by: Davlet Panech <davlet.panech@windriver.com> Change-Id: If1dcc157e1ce6171779f8143f6fbb7cbd0d02676
33 lines
859 B
Bash
Executable File
33 lines
859 B
Bash
Executable File
#!/bin/bash
|
|
|
|
#
|
|
# Copyright (c) 2022 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
set -e
|
|
source $(dirname "$0")/lib/job_utils.sh
|
|
|
|
require_job_env BUILD_HOME
|
|
load_build_config
|
|
|
|
if [[ ! -f "$BUILD_HOME/$REPO_ROOT_SUBDIR/stx-tools/import-stx" ]] ; then
|
|
warn "$BUILD_HOME/$REPO_ROOT_SUBDIR/stx-tools/import-stx: file doesn't exist"
|
|
warn "Can't stop containers, bailing out"
|
|
exit 0
|
|
fi
|
|
|
|
load_build_env
|
|
stx control stop || true
|
|
|
|
# Prune minikube's docker, then stop minikube's top-level container
|
|
if [[ "$STX_PLATFORM" == "minikube" ]] ; then
|
|
profile_args=()
|
|
[[ -z "$MINIKUBENAME" ]] || profile_args+=("-p" "$MINIKUBENAME")
|
|
if minikube "${profile_args[@]}" status >/dev/null ; then
|
|
minikube "${profile_args[@]}" ssh -- 'docker system prune --volumes --force'
|
|
minikube "${profile_args[@]}" stop
|
|
fi
|
|
fi
|