File tree 1 file changed +9
-3
lines changed 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -99,15 +99,21 @@ 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
107
109
108
110
if [[ -z " ${OS_BUILD_ENV_REUSE_TMP_VOLUME:- } " ]]; then
109
- os::log::debug " Removing tmp volume"
110
- os::build::environment::remove_volume " ${OS_BUILD_ENV_TMP_VOLUME} "
111
+ os::log::debug " Removing tmp build volume"
112
+ os::build::environment::remove_volume " ${tmp_volume} "
113
+ fi
114
+ if [[ -n ${OS_BUILD_ENV_CLEAN_BUILD_VOLUME:- } ]]; then
115
+ os::log::debug " Removing build volume"
116
+ os::build::environment::remove_volume ${volume}
111
117
fi
112
118
fi
113
119
}
@@ -257,7 +263,7 @@ function os::build::environment::run() {
257
263
258
264
local container
259
265
container=" $( os::build::environment::create " $@ " ) "
260
- trap " os::build::environment::cleanup ${container} " EXIT
266
+ trap " os::build::environment::cleanup ${container} ${volume} ${tmp_volume} " EXIT
261
267
262
268
os::log::debug " Using container ${container} "
263
269
You can’t perform that action at this time.
0 commit comments