File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,17 @@ readonly -f os::build::environment::release::workingdir
99
99
# (unless OS_BUILD_ENV_LEAVE_CONTAINER is set, in which case it will only stop the container).
100
100
function os::build::environment::cleanup() {
101
101
local container=$1
102
+ local volume=$2
103
+ local tmp_volume=$3
102
104
os::log::debug " Stopping container ${container} "
103
105
docker stop --time=0 " ${container} " > /dev/null || true
104
106
if [[ -z " ${OS_BUILD_ENV_LEAVE_CONTAINER:- } " ]]; then
105
107
os::log::debug " Removing container ${container} "
106
108
docker rm " ${container} " > /dev/null
109
+ if [[ -n ${OS_BUILD_ENV_CLEAN_VOLUMES:- } ]]; then
110
+ os::build::environment::remove_volume ${volume}
111
+ os::build::environment::remove_volume ${tmp_volume}
112
+ fi
107
113
fi
108
114
}
109
115
readonly -f os::build::environment::cleanup
@@ -252,7 +258,7 @@ function os::build::environment::run() {
252
258
253
259
local container
254
260
container=" $( os::build::environment::create " $@ " ) "
255
- trap " os::build::environment::cleanup ${container} " EXIT
261
+ trap " os::build::environment::cleanup ${container} ${volume} ${tmp_volume} " EXIT
256
262
257
263
os::log::debug " Using container ${container} "
258
264
You can’t perform that action at this time.
0 commit comments