Chore: Remove stable/argon jobs
[releng/builder.git] / jjb / generate-csit-status-report.sh
index dc8753728af6547013442e110b7f259e59a08214..25c50c2a7a031e1788bf788577c05476f7ad1a7f 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
@@ -12,7 +12,7 @@
 
 script=$(mktemp)
 
-cat > $script <<EOF
+cat > "$script" <<EOF
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
@@ -40,25 +40,26 @@ page = requests.get(build_url)
 soup = BeautifulSoup(page.text, 'html.parser')
 links = soup.findAll("a", { "class" : "model-link" })
 
-_file = open('csit_failed_tests.txt', 'w+')
+with open('csit_failed_tests.txt', 'w+') as _file:
+    for link in links:
+        if link.img and (link.img['alt'] == 'Unstable' or
+                         link.img['alt'] == 'Failed' or
+                         link.img['alt'] == 'Aborted'):
 
-for link in links:
-    if link.img and (link.img['alt'] == 'Unstable' or
-                     link.img['alt'] == 'Failed' or
-                     link.img['alt'] == 'Aborted'):
-
-        url = link['href']
-        project = url.split('/')[3].split('-')[0]
-        _file.write("{}\t{}{}\n".format(project, jenkins_url, url))
-
-_file.close()
+            url = link['href']
+            project = url.split('/')[3].split('-')[0]
+            _file.write("{}\\t{}{}\\n".format(project, jenkins_url, url))
 EOF
 
-virtualenv --quiet "/tmp/v/jenkins"
+python3 -m venv "/tmp/v/jenkins"
 # shellcheck source=/tmp/v/jenkins/bin/activate disable=SC1091
-source "/tmp/v/jenkins/bin/activate"
-pip install --quiet --upgrade pip
-pip install --quiet --upgrade tox beautifulsoup4 requests
+. "/tmp/v/jenkins/bin/activate"
+# Remove pip cache to avoid cache entry deserialization failures
+rm -rf ~/.cache/pip/
+pip install --quiet --upgrade pip setuptools
+pip install --quiet --upgrade tox
+pip install --quiet --upgrade beautifulsoup4
+pip install --quiet --upgrade requests
 
 echo python "$script" "$BUILD_URL"
 python "$script" "$BUILD_URL"