File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
bash/artifacts/opt/jboss/container/s2i/core Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -95,10 +95,15 @@ envs:
95
95
96
96
- name : S2I_ENABLE_INCREMENTAL_BUILDS
97
97
description : ^
98
- Do not remove source and intermediate build files so they can be saved for
98
+ Do not remove intermediate build files so they can be saved for
99
99
use with future builds. Defaults to true.
100
100
example : " true"
101
101
102
+ - name : S2I_DELETE_SOURCE
103
+ description : ^
104
+ Delete source files at the end of build. Defaults to true.
105
+ example : " false"
106
+
102
107
# deprecated
103
108
- name : APP_DATADIR
104
109
description : Deprecated by **S2I_SOURCE_DATA_DIR**.
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ function s2i_core_env_init() {
32
32
S2I_TARGET_DATA_DIR="${S2I_TARGET_DATA_DIR:-${JAVA_DATA_DIR:-${DATA_DIR:-${S2I_TARGET_DEPLOYMENTS_DIR}}}}"
33
33
S2I_IMAGE_SOURCE_MOUNTS="${S2I_IMAGE_SOURCE_MOUNTS:-${CUSTOM_INSTALL_DIRECTORIES}}"
34
34
S2I_ENABLE_INCREMENTAL_BUILDS="${S2I_ENABLE_INCREMENTAL_BUILDS:-true}"
35
+ S2I_DELETE_SOURCE="${S2I_DELETE_SOURCE:-true}"
35
36
36
37
s2i_core_env_backward_compatibility
37
38
}
@@ -145,9 +146,11 @@ function s2i_core_process_image_mounts() {
145
146
}
146
147
147
148
function s2i_core_cleanup() {
148
- if [ -n "$(find ${S2I_SOURCE_DIR} -maxdepth 0 -type d ! -empty 2> /dev/null)" ]; then
149
- log_info "Cleaning up source directory (${S2I_SOURCE_DIR})"
150
- rm -rf ${S2I_SOURCE_DIR}
149
+ if [ "${S2I_DELETE_SOURCE,,}" == "true" ]; then
150
+ if [ -n "$(find ${S2I_SOURCE_DIR} -maxdepth 0 -type d ! -empty 2> /dev/null)" ]; then
151
+ log_info "Cleaning up source directory (${S2I_SOURCE_DIR})"
152
+ rm -rf ${S2I_SOURCE_DIR}
153
+ fi
151
154
fi
152
155
if [ "${S2I_ENABLE_INCREMENTAL_BUILDS,,}" == "true" ]; then
153
156
return 0
You can’t perform that action at this time.
0 commit comments