tcwg-report-stale-rr-jobs: Add unstable version for report-stale-jobs

Change-Id: Ia0f859669b1d37618e0a79f469decc84d3f43dc7
diff --git a/tcwg-report-stale-rr-jobs-unstable.yaml b/tcwg-report-stale-rr-jobs-unstable.yaml
new file mode 100644
index 0000000..27f674f
--- /dev/null
+++ b/tcwg-report-stale-rr-jobs-unstable.yaml
@@ -0,0 +1,105 @@
+# Auto generated by ./tcwg/generate-yamlfiles.sh from tcwg-report-stale-rr-jobs.yaml.in and tcwg-report-stale-rr-jobs/tcwg-report-stale-rr-jobs-unstable.def. Do not edit.
+#BEGIN: tcwg/default.yaml.inc
+# -*- mode: Yaml -*-
+
+- property:
+    name: default-properties
+    properties:
+      - authorization:
+          anonymous:
+            - job-read
+            - job-extended-read
+          everyone-flat:
+            - job-build
+            - job-cancel
+      - build-discarder:
+          days-to-keep: 20
+
+- scm:
+    name: jenkins-scripts-master
+    scm:
+      - git:
+          url: https://gitlab.com/Linaro/tcwg/jenkins-scripts.git
+          refspec: +refs/heads/master:refs/remotes/origin/master
+          branches:
+            - master
+          basedir: jenkins-scripts
+          skip-tag: true
+          reference-repo: /home/tcwg-buildslave/snapshots-ref/jenkins-scripts.git
+          wipe-workspace: false
+          clean:
+            before: true
+          prune: true
+
+#END:   tcwg/default.yaml.inc
+
+- job:
+    name: tcwg-report-stale-rr-jobs-unstable
+    project-type: freestyle
+    defaults: global
+    properties:
+      - default-properties
+    parameters:
+      - string:
+          name: days
+          default: 8
+          description: 'List jobs with no successful run in DAYS'
+      - string:
+          name: days_per_project_extra_params
+          default: ==days_per_project[tcwg_flang] 1 ==days_per_project[tcwg_chromium] 360
+          description: 'For the specified projects, use this DAYS value'
+    disabled: false
+    node: tcwg-coordinator
+    concurrent: false
+    display-name: 'TCWG CCC Report Stale RR Jobs (unstable)'
+    scm:
+      - jenkins-scripts-master
+    triggers:
+      - timed: '@daily'
+    wrappers:
+      - timeout:
+          timeout: 300
+      - timestamps
+      - ssh-agent-credentials:
+          # tcwg-buildslave user id
+          users:
+            - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
+    builders:
+      - shell: |
+          #!/bin/bash
+          set -euf -o pipefail
+          set -x
+
+          rm -rf artifacts
+          mkdir artifacts
+          bash -x ./jenkins-scripts/tcwg-report-stale-rr-jobs.sh --days "$days" \
+              --report_projects unstable \
+              $days_per_project_extra_params \
+              --output artifacts/stale-jobs.log
+          bash -x ./jenkins-scripts/tcwg-report-stale-rr-jobs.sh \
+              --classify artifacts/stale-jobs.log \
+              --output artifacts/stale-jobs-analysis.log || true
+          # Count the number non-empty nor non-comments lines
+          n_lines=$(grep -c -v -E '^#|^$' artifacts/stale-jobs.log || true)
+          ./jenkins-scripts/tcwg-report-ci-status.sh > artifacts/ci-status.log
+          if [ x"$n_lines" != x"0" ]; then
+            (
+              echo "Jobs with no new results in $days days ($n_lines entries):"
+              cat artifacts/ci-status.log
+              cat artifacts/stale-jobs-analysis.log
+              cat artifacts/stale-jobs.log
+            ) > artifacts/email-body.txt
+            exit 1
+          fi
+    publishers:
+        - archive:
+            artifacts: 'artifacts/**'
+            latest-only: false
+        - email-ext:
+            recipients: 'maxim.kuvyrkov@linaro.org, laurent.alfonsi@linaro.org'
+            content-type: text
+            body: |
+              ${FILE,path="artifacts/email-body.txt"}
+            failure: true
+            aborted: true
+# checksum: 572ad6d95fdf142c495b98cda338c98e
diff --git a/tcwg-report-stale-rr-jobs/tcwg-report-stale-rr-jobs-unstable.def b/tcwg-report-stale-rr-jobs/tcwg-report-stale-rr-jobs-unstable.def
new file mode 100644
index 0000000..afe40d6
--- /dev/null
+++ b/tcwg-report-stale-rr-jobs/tcwg-report-stale-rr-jobs-unstable.def
@@ -0,0 +1,2 @@
+-v JENKINS_SCRIPTS=master
+-v REPORT_PROJECTS=unstable