Skip to content

Commit aeaa04f

Browse files
committed
allow running root ci scripts in BUILD_SUBDIR
1 parent 2730b93 commit aeaa04f

3 files changed

Lines changed: 30 additions & 1 deletion

File tree

.kokoro/build.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,17 @@ if [ -f "${KOKORO_GFILE_DIR}/secret_manager/java-bigqueryconnection-samples-secr
3333
source "${KOKORO_GFILE_DIR}/secret_manager/java-bigqueryconnection-samples-secrets"
3434
fi
3535

36+
if [[ -n "${BUILD_SUBDIR}" ]]
37+
then
38+
echo "Running in subdir: ${BUILD_SUBDIR}"
39+
pushd "${BUILD_SUBDIR}"
40+
fi
41+
3642
RETURN_CODE=0
3743

3844
case ${JOB_TYPE} in
3945
test)
46+
echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}"
4047
retry_with_backoff 3 10 \
4148
mvn test \
4249
-B -ntp \
@@ -48,7 +55,7 @@ case ${JOB_TYPE} in
4855
-Dflatten.skip=true \
4956
-Danimal.sniffer.skip=true \
5057
-Dmaven.wagon.http.retryHandler.count=5 \
51-
-T 1C
58+
-T 1C ${SUREFIRE_JVM_OPT}
5259
RETURN_CODE=$?
5360
echo "Finished running unit tests"
5461
;;
@@ -125,6 +132,12 @@ case ${JOB_TYPE} in
125132

126133
esac
127134

135+
if [[ -n "${BUILD_SUBDIR}" ]]
136+
then
137+
echo "restoring directory"
138+
popd
139+
fi
140+
128141
if [ "${REPORT_COVERAGE}" == "true" ]; then
129142
bash ${KOKORO_GFILE_DIR}/codecov.sh
130143
fi

.kokoro/dependencies.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ function determineMavenOpts() {
4949

5050
export MAVEN_OPTS=$(determineMavenOpts)
5151

52+
if [[ -n "${BUILD_SUBDIR}" ]]
53+
then
54+
echo "Running in subdir: ${BUILD_SUBDIR}"
55+
pushd "${BUILD_SUBDIR}"
56+
fi
57+
5258
# this should run maven enforcer
5359
retry_with_backoff 3 10 \
5460
mvn install -B -V -ntp \
@@ -57,3 +63,9 @@ retry_with_backoff 3 10 \
5763
-Dclirr.skip=true
5864

5965
mvn -B dependency:analyze -DfailOnWarning=true
66+
67+
if [[ -n "${BUILD_SUBDIR}" ]]
68+
then
69+
echo "Leaving subdir: ${BUILD_SUBDIR}"
70+
popd
71+
fi

generation/check_non_release_please_versions.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ for pomFile in $(find . -mindepth 2 -name pom.xml | sort ); do
1919
echo "Skipping version check for java-samples directory"
2020
continue
2121
fi
22+
if [[ "${pomFile}" =~ .*/samples/.* ]]; then
23+
echo "Skipping version check for samples directory"
24+
continue
25+
fi
2226

2327
if grep -n '<version>.*</version>' "$pomFile" | grep -v 'x-version-update'; then
2428
echo "Found version declaration(s) without x-version-update in: $pomFile"

0 commit comments

Comments
 (0)