aboutsummaryrefslogtreecommitdiff
path: root/tcwg-report-stale-rr-jobs.yaml.in
blob: 4887c968d9ba4e843ab4e2526327c74be5c7ba24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include tcwg/default.yaml.inc

- job:
    name: tcwg-report-stale-rr-jobs
    project-type: freestyle
    defaults: global
    properties:
      - default-properties
    parameters:
      - string:
          name: days
          default: 8
          description: 'List jobs with no successful run in DAYS'
    disabled: false
    node: tcwg-coordinator
    concurrent: false
    display-name: 'TCWG CCC Report Stale RR Jobs'
    scm:
      - jenkins-scripts-master
    triggers:
      - timed: '@daily'
    wrappers:
      - timeout:
          timeout: 300
      - timestamps
    builders:
      - shell: |
          #!/bin/bash
          set -euf -o pipefail
          set -x

          rm -rf artifacts
          mkdir artifacts
          ./jenkins-scripts/tcwg-report-stale-rr-jobs.sh --days "$days" 2>&1 \
            | tee artifacts/stale-jobs.log
          n_lines=$(cat artifacts/stale-jobs.log | wc -l)
          if [ x"$n_lines" != x"0" ]; then
            (
              echo "Jobs with no new results in $days days ($n_lines entries):"
              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
            content-type: text
            body: |
              ${FILE,path="artifacts/email-body.txt"}
            failure: true
            aborted: true