This is an automated email from the ASF dual-hosted git repository.

mcvsubbu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 46a4cf7  Fix maven settings file collision (#7287)
46a4cf7 is described below

commit 46a4cf7856a9ea7ac927f4386b08aeb19ba68e5c
Author: Subbu Subramaniam <mcvsu...@users.noreply.github.com>
AuthorDate: Thu Aug 12 09:02:03 2021 -0700

    Fix maven settings file collision (#7287)
    
    * Fix maven settings file collision
    
    It is intended that a CI pipeline passes its own maven settings file
    into the checkoutAndBuild command as an env variable rather than
    creating a hard-coded setting file inside the script.
    
    Creating a new settings file broke the CICD build pipeline in our
    organization.
    
    * Fix the path of the settings file
    
    * Fix settings file to be outside source dir
    
    * Output the entire build file on failure.
---
 .../scripts/.pinot_compatibility_verifier.sh       | 20 ++++++++++++++++-
 compatibility-verifier/checkoutAndBuild.sh         | 25 ++++++++--------------
 2 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/.github/workflows/scripts/.pinot_compatibility_verifier.sh 
b/.github/workflows/scripts/.pinot_compatibility_verifier.sh
index d30fdc1..cbe76f6 100755
--- a/.github/workflows/scripts/.pinot_compatibility_verifier.sh
+++ b/.github/workflows/scripts/.pinot_compatibility_verifier.sh
@@ -27,6 +27,24 @@ netstat -i
 
 df -h
 
+SETTINGS_FILE="../settings.xml"
+
+echo "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\"";> 
${SETTINGS_FILE}
+echo "      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";>> 
${SETTINGS_FILE}
+echo "      xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0";>> 
${SETTINGS_FILE}
+echo "                          
https://maven.apache.org/xsd/settings-1.0.0.xsd\";>">> ${SETTINGS_FILE}
+echo "  <mirrors>">> ${SETTINGS_FILE}
+echo "    <mirror>">> ${SETTINGS_FILE}
+echo "      <id>confluent-mirror</id>">> ${SETTINGS_FILE}
+echo "      <mirrorOf>confluent</mirrorOf>">> ${SETTINGS_FILE}
+echo "      <url>https://packages.confluent.io/maven/</url>">> ${SETTINGS_FILE}
+echo "      <blocked>false</blocked>">> ${SETTINGS_FILE}
+echo "    </mirror>">> ${SETTINGS_FILE}
+echo "  </mirrors>">> ${SETTINGS_FILE}
+echo "</settings>">> ${SETTINGS_FILE}
+
+# PINOT_MAVEN_OPTS is used to provide additional maven options to the 
checkoutAndBuild.sh command
+export PINOT_MAVEN_OPTS="-s $(pwd)/${SETTINGS_FILE}"
 compatibility-verifier/checkoutAndBuild.sh -w $WORKING_DIR -o $OLD_COMMIT
 
-compatibility-verifier/compCheck.sh -w $WORKING_DIR -t $TEST_SUITE
\ No newline at end of file
+compatibility-verifier/compCheck.sh -w $WORKING_DIR -t $TEST_SUITE
diff --git a/compatibility-verifier/checkoutAndBuild.sh 
b/compatibility-verifier/checkoutAndBuild.sh
index d51968d..577b897 100755
--- a/compatibility-verifier/checkoutAndBuild.sh
+++ b/compatibility-verifier/checkoutAndBuild.sh
@@ -75,19 +75,6 @@ function build() {
   local versionOption="-Djdk.version=8"
 
   mkdir -p ${MVN_CACHE_DIR}
-  echo "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\"";> 
../settings.xml
-  echo "      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";>> 
../settings.xml
-  echo "      xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0";>> 
../settings.xml
-  echo "                          
https://maven.apache.org/xsd/settings-1.0.0.xsd\";>">> ../settings.xml
-  echo "  <mirrors>">> ../settings.xml
-  echo "    <mirror>">> ../settings.xml
-  echo "      <id>confluent-mirror</id>">> ../settings.xml
-  echo "      <mirrorOf>confluent</mirrorOf>">> ../settings.xml
-  echo "      <url>https://packages.confluent.io/maven/</url>">> 
../settings.xml
-  echo "      <blocked>false</blocked>">> ../settings.xml
-  echo "    </mirror>">> ../settings.xml
-  echo "  </mirrors>">> ../settings.xml
-  echo "</settings>">> ../settings.xml
 
   if [ ${buildId} -gt 0 ]; then
     # Build it in a different env under different version so that maven cache 
does
@@ -98,12 +85,12 @@ function build() {
     repoOption="-Dmaven.repo.local=${mvnCache}/${buildId}"
   fi
 
-  mvn install package -s ../settings.xml -DskipTests -Pbin-dist 
${versionOption} ${repoOption} ${PINOT_MAVEN_OPTS} 1>${outFile} 2>&1
+  mvn install package -DskipTests -Pbin-dist ${versionOption} ${repoOption} 
${PINOT_MAVEN_OPTS} 1>${outFile} 2>&1
   if [ $? -ne 0 ]; then exit 1; fi
-  mvn -pl pinot-tools package -s ../settings.xml -DskipTests ${versionOption} 
${repoOption} ${PINOT_MAVEN_OPTS} 1>>${outFile} 2>&1
+  mvn -pl pinot-tools package -DskipTests ${versionOption} ${repoOption} 
${PINOT_MAVEN_OPTS} 1>>${outFile} 2>&1
   if [ $? -ne 0 ]; then exit 1; fi
   if [ $buildTests -eq 1 ]; then
-    mvn -pl pinot-integration-tests package -s ../settings.xml -DskipTests 
${versionOption} ${repoOption} ${PINOT_MAVEN_OPTS} 1>>${outFile} 2>&1
+    mvn -pl pinot-integration-tests package -DskipTests ${versionOption} 
${repoOption} ${PINOT_MAVEN_OPTS} 1>>${outFile} 2>&1
     if [ $? -ne 0 ]; then exit 1; fi
   fi
 }
@@ -274,7 +261,9 @@ if [ ${oldBuildStatus} -eq 0 ]; then
   echo Old version build completed successfully
 else
   echo Old version build failed. See ${oldBuildOutFile}
+  echo ======== Build output ========
   cat ${oldBuildOutFile}
+  echo ==== End Build output ========
   exitStatus=1
 fi
 
@@ -282,7 +271,9 @@ if [ ${curBuildStatus} -eq 0 ]; then
   echo Compat checker build completed successfully
 else
   echo Compat checker build failed. See ${curBuildOutFile}
+  echo ======== Build output ========
   cat ${curBuildOutFile}
+  echo ==== End Build output ========
   exitStatus=1
 fi
 
@@ -291,7 +282,9 @@ if [ ${buildNewTarget} -eq 1 ]; then
     echo New version build completed successfully
   else
     echo New version build failed. See ${newBuildOutFile}
+    echo ======== Build output ========
     cat ${newBuildOutFile}
+    echo ==== End Build output ========
     exitStatus=1
   fi
 fi

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to