Fix ShellCheck v0.4.7 lint issues
[releng/global-jjb.git] / .jjb-test / expected-xml / github-python-tox-verify-master
index c266342..6d758b8 100644 (file)
@@ -96,7 +96,7 @@ Example: docs,py2,py3
     </userRemoteConfigs>
     <branches>
       <hudson.plugins.git.BranchSpec>
-        <name>**</name>
+        <name>$sha1</name>
       </hudson.plugins.git.BranchSpec>
     </branches>
     <excludedUsers/>
@@ -292,13 +292,17 @@ run_tox() {
     local log_dir=&quot;$1&quot;
     local env=&quot;$2&quot;
 
+    # Sleep a random 10 second interval to workaround tox sdist
+    # conflicts due to building in the same dist directory.
+    sleep $[ ( $RANDOM % 10 )  + 1 ]s
+
     echo &quot;-----&gt; Running tox $env&quot;
     if ! tox -e $env &gt; &quot;$log_dir/tox-$env.log&quot;; then
         echo &quot;$env&quot; &gt;&gt; &quot;$log_dir/failed-envs.log&quot;
     fi
 }
 
-TOX_ENVS=(${TOX_ENVS//,/ })
+IFS=&quot; &quot; read -r -a TOX_ENVS &lt;&lt;&lt; &quot;${TOX_ENVS//,/ }&quot;
 if hash parallel 2&gt;/dev/null; then
     export -f run_tox
     parallel --jobs 200% &quot;run_tox $ARCHIVE_TOX_DIR {}&quot; ::: ${TOX_ENVS[*]}
@@ -309,7 +313,11 @@ else
 fi
 
 if [ -f &quot;$ARCHIVE_TOX_DIR/failed-envs.log&quot; ]; then
-    failed_envs=($(cat &quot;$ARCHIVE_TOX_DIR/failed-envs.log&quot;))
+    mapfile -t failed_envs &lt; &lt;(cat &quot;$ARCHIVE_TOX_DIR/failed-envs.log&quot;)
+    for e in &quot;${failed_envs[@]}&quot;; do
+        echo &quot;cat $ARCHIVE_TOX_DIR/tox-$e.log&quot;
+        cat &quot;$ARCHIVE_TOX_DIR/tox-$e.log&quot;
+    done
     echo &quot;ERROR: Failed the following builds: ${failed_envs[*]}&quot;
     exit 1
 fi
@@ -358,9 +366,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.
@@ -397,7 +405,7 @@ echo &quot;---&gt; create-netrc.sh&quot;
 # Ensure we fail the job if any steps fail.
 set -eu -o pipefail
 
-NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
+NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
 CREDENTIAL=$(xmlstarlet sel -N &quot;x=http://maven.apache.org/SETTINGS/1.0.0&quot; \
     -t -m &quot;/x:settings/x:servers/x:server[x:id='${SERVER_ID}']&quot; \
     -v x:username -o &quot;:&quot; -v x:password \
@@ -407,7 +415,7 @@ machine=$(echo &quot;$NEXUS_URL&quot; | awk -F/ '{print $3}')
 user=$(echo &quot;$CREDENTIAL&quot; | cut -f1 -d:)
 pass=$(echo &quot;$CREDENTIAL&quot; | cut -f2 -d:)
 
-echo &quot;machine $machine login $user password $pass&quot; &gt; ~/.netrc
+echo &quot;machine ${machine%:*} login $user password $pass&quot; &gt; ~/.netrc
 </command>
         </hudson.tasks.Shell>
         <hudson.tasks.Shell>
@@ -523,7 +531,7 @@ then
 
     echo &quot;WARNING: Logging server not set&quot;
 else
-    NEXUS_URL=&quot;${NEXUS_URL:-$NEXUSPROXY}&quot;
+    NEXUS_URL=&quot;${NEXUSPROXY:-$NEXUS_URL}&quot;
     NEXUS_PATH=&quot;${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}&quot;
     BUILD_URL=&quot;${BUILD_URL}&quot;
 
@@ -595,5 +603,14 @@ rm ~/.netrc
       <user>test-credential</user>
     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
     <jenkins.plugins.openstack.compute.JCloudsOneOffSlave/>
+    <org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper plugin="config-file-provider">
+      <managedFiles>
+        <org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
+          <fileId>npmrc</fileId>
+          <targetLocation>$HOME/.npmrc</targetLocation>
+          <variable/>
+        </org.jenkinsci.plugins.configfiles.buildwrapper.ManagedFile>
+      </managedFiles>
+    </org.jenkinsci.plugins.configfiles.buildwrapper.ConfigFileBuildWrapper>
   </buildWrappers>
 </project>