Skip to content

Commit

Permalink
GEODE-6236 fix inconsistent handling of versionNumber
Browse files Browse the repository at this point in the history
In a few build scripts versionNumber was obtained by parsing gradle.properties directly. This approach gave incorrect value if that property had been overridden with a -P on the gradle command line.

Now the overrides are considered before the properties file, mimicking the value gradle would choose in all cases.
  • Loading branch information
onichols-pivotal committed Dec 21, 2018
1 parent 9633c1f commit d53fbcd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ci/scripts/archive_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fi
SANITIZED_GRADLE_TASK=${GRADLE_TASK##*:}
TMPDIR=${DEST_DIR}/tmp
GEODE_BUILD=${DEST_DIR}/geode
GEODE_BUILD_VERSION_NUMBER=$(grep "versionNumber *=" ${GEODE_BUILD}/gradle.properties | awk -F "=" '{print $2}' | tr -d ' ')
GEODE_BUILD_VERSION_NUMBER=$(echo "${GRADLE_GLOBAL_ARGS}"|tr ' ' '\n' | grep "versionNumber *=" - ${GEODE_BUILD}/gradle.properties | awk -F "=" '{print $2; exit}' | tr -d ' ')
BUILD_TIMESTAMP=$(date +%s)

GEODE_PULL_REQUEST_ID_FILE=${BUILDROOT}/geode/.git/resource/version.json
Expand Down
3 changes: 2 additions & 1 deletion ci/scripts/execute_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ BUILD_DATE=$(date +%s)
if [ -e "${ROOT_DIR}/geode-build-version" ] ; then
GEODE_BUILD_VERSION_FILE=${ROOT_DIR}/geode-build-version/number
GEODE_RESULTS_VERSION_FILE=${ROOT_DIR}/results/number
GEODE_BUILD_VERSION_NUMBER=$(grep "versionNumber *=" geode/gradle.properties | awk -F "=" '{print $2}' | tr -d ' ')
GEODE_BUILD_VERSION_NUMBER=$(echo "${GRADLE_GLOBAL_ARGS}"|tr ' ' '\n' | grep "versionNumber *=" - geode/gradle.properties | awk -F "=" '{print $2; exit}' | tr -d ' ')
GEODE_BUILD_DIR=/tmp/geode-build
GEODE_PULL_REQUEST_ID_FILE=${ROOT_DIR}/geode/.git/id

Expand Down Expand Up @@ -99,6 +99,7 @@ GRADLE_ARGS="\
${DEFAULT_GRADLE_TASK_OPTIONS} \
${GRADLE_SKIP_TASK_OPTIONS} \
${GRADLE_GLOBAL_ARGS} \
-PbuildId=${BUILD_ID} \
build install javadoc spotlessCheck rat checkPom resolveDependencies -x test"

EXEC_COMMAND="mkdir -p tmp && cd geode && ${SET_JAVA_HOME} && ./gradlew ${GRADLE_ARGS}"
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/execute_publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ EMAIL_BODY="results/body"

GEODE_BUILD_VERSION_FILE=${ROOT_DIR}/geode-build-version/number
GEODE_RESULTS_VERSION_FILE=${ROOT_DIR}/results/number
GEODE_BUILD_VERSION_NUMBER=$(grep "versionNumber *=" geode/gradle.properties | awk -F "=" '{print $2}' | tr -d ' ')
GEODE_BUILD_VERSION_NUMBER=$(echo "${GRADLE_GLOBAL_ARGS}"|tr ' ' '\n' | grep "versionNumber *=" - geode/gradle.properties | awk -F "=" '{print $2; exit}' | tr -d ' ')
GEODE_BUILD_DIR=/tmp/geode-build
GEODE_PULL_REQUEST_ID_FILE=${ROOT_DIR}/geode/.git/id

Expand Down

0 comments on commit d53fbcd

Please sign in to comment.