Update remote gerrit to use GERRIT_URL
[releng/global-jjb.git] / .jjb-test / expected-xml / gerrit-maven-maven-verify-deps-master-mvn33-openjdk8
index c9f38b1..17ea739 100644 (file)
@@ -102,6 +102,11 @@ For example '<1.0.0' or '>=1.0.0,<2.0.0'.
 </description>
           <defaultValue>uuddlrlrba</defaultValue>
         </hudson.model.StringParameterDefinition>
+        <hudson.model.StringParameterDefinition>
+          <name>ARCHIVE_ARTIFACTS</name>
+          <description>Artifacts to archive to the logs server.</description>
+          <defaultValue/>
+        </hudson.model.StringParameterDefinition>
       </parameterDefinitions>
     </hudson.model.ParametersDefinitionProperty>
   </properties>
@@ -258,7 +263,7 @@ set -eu -o pipefail
 
 REPOS_DIR=&quot;$WORKSPACE/.repos&quot;
 
-PATCHES=($(echo &quot;$GERRIT_EVENT_COMMENT_TEXT&quot; | grep 'recheck:' | awk -F: '{print $2}'))
+IFS=&quot; &quot; read -r -a PATCHES &lt;&lt;&lt; &quot;$(echo &quot;$GERRIT_EVENT_COMMENT_TEXT&quot; | grep 'recheck:' | awk -F: '{print $2}')&quot;
 
 projects=()
 for patch in $(echo &quot;${PATCHES[@]}&quot;); do
@@ -273,8 +278,22 @@ for patch in $(echo &quot;${PATCHES[@]}&quot;); do
         projects+=(&quot;$project&quot;)
     fi
 
+    # Workaround for git-review bug in v1.24
+    # https://storyboard.openstack.org/#!/story/2001081
+    set +u  # Allow unbound variables for virtualenv
+    virtualenv --quiet &quot;/tmp/v/git-review&quot;
+    # shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091
+    source &quot;/tmp/v/git-review/bin/activate&quot;
+    pip install --quiet --upgrade pip
+    pip install --quiet --upgrade git-review
+    set -u
+    # End git-review workaround
+
     pushd &quot;$REPOS_DIR/$project&quot;
-    git remote add gerrit &quot;$GIT_URL/$project&quot;
+    # If remote gerrit already exists just make sure path is expected
+    if ! git remote add gerrit &quot;$GERRIT_URL/$project&quot; &gt; /dev/null 2&gt;&amp;1; then
+        git remote set-url gerrit &quot;$GERRIT_URL/$project&quot;
+    fi
     git review --cherrypick=&quot;$patch&quot;
     popd
 done
@@ -335,7 +354,7 @@ echo &quot;$MAVEN_OPTIONS&quot;
 set -e -o pipefail
 set +u
 
-PROJECTS=($(echo &quot;$DEPENDENCY_BUILD_ORDER&quot;))
+IFS=&quot; &quot; read -r -a PROJECTS &lt;&lt;&lt; &quot;$DEPENDENCY_BUILD_ORDER&quot;
 REPOS_DIR=&quot;$WORKSPACE/.repos&quot;
 
 export MAVEN_OPTS
@@ -349,7 +368,7 @@ for project in &quot;${PROJECTS[@]}&quot;; do
         -DskipTests=true \
         --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
         --settings &quot;$SETTINGS_FILE&quot; \
-        $MAVEN_PARAMS $MAVEN_OPTIONS
+        $MAVEN_OPTIONS $MAVEN_PARAMS
     popd
 done
 </command>
@@ -405,7 +424,7 @@ $MVN clean deploy \
     --global-settings &quot;$GLOBAL_SETTINGS_FILE&quot; \
     --settings &quot;$SETTINGS_FILE&quot; \
     -DaltDeploymentRepository=staging::default::file:&quot;$WORKSPACE&quot;/m2repo \
-    $MAVEN_PARAMS $MAVEN_OPTIONS
+    $MAVEN_OPTIONS $MAVEN_PARAMS
 </command>
     </hudson.tasks.Shell>
     <hudson.tasks.Shell>
@@ -504,9 +523,9 @@ SAR_DIR=&quot;$WORKSPACE/archives/sar-reports&quot;
 mkdir -p &quot;$SAR_DIR&quot;
 cp &quot;$SYSSTAT_PATH/&quot;* &quot;$_&quot;
 # convert sar data to ascii format
-while IFS=&quot;&quot; read -r s
+while IFS=&quot;&quot; read -r sarfilenum
 do
-    [ -f &quot;$s&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$s&quot; &gt; &quot;$SAR_DIR/sar${s//[!0-9]/}&quot;
+    [ -f &quot;$sarfilenum&quot; ] &amp;&amp; LC_TIME=POSIX sar -A -f &quot;$sarfilenum&quot; &gt; &quot;$SAR_DIR/sar${sarfilenum//[!0-9]/}&quot;
 done &lt; &lt;(find &quot;$SYSSTAT_PATH&quot; -name &quot;sa[0-9]*&quot; || true)
 
 # DON'T fail build if script fails.