File tree 1 file changed +17
-2
lines changed
hadoop-ozone/dist/src/main/compose 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,23 @@ source "${_testlib_dir}/../smoketest/testlib.sh"
31
31
: ${SECURITY_ENABLED:= false}
32
32
: ${SCM:= scm}
33
33
34
- # version is used in bucket name, which does not allow uppercase
35
- export OZONE_CURRENT_VERSION=" $( echo " ${ozone.version} " | sed -e ' s/-SNAPSHOT//' | tr ' [:upper:]' ' [:lower:]' ) "
34
+ # Check if running from output of Maven build or from source
35
+ _is_build () {
36
+ local file=" "
37
+ # Variable is replaced by Maven at build time,
38
+ # so if it empty, we are running from source, if non-empty, then running in build output (target)
39
+ [[ -n " ${file} " ]]
40
+ }
41
+
42
+ # Avoid `bad substitution` error
43
+ if _is_build; then
44
+ # version is used in bucket name, which does not allow uppercase
45
+ # variable is replaced by Maven at build time
46
+ OZONE_CURRENT_VERSION=" $( echo " ${ozone.version} " | sed -e ' s/-SNAPSHOT//' | tr ' [:upper:]' ' [:lower:]' ) "
47
+ else
48
+ OZONE_CURRENT_VERSION=src
49
+ fi
50
+ export OZONE_CURRENT_VERSION
36
51
37
52
# create temp directory for test data; only once, even if testlib.sh is sourced again
38
53
if [[ -z " ${TEST_DATA_DIR:- } " ]] && [[ " ${KEEP_RUNNING:- false} " == " false" ]]; then
You can’t perform that action at this time.
0 commit comments