aboutsummaryrefslogtreecommitdiff
path: root/ci-ssh-cleanup.yaml
blob: 0d3b1678cbad8d7a1c127cb2939f3ac89668e0e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- job:
    name: ci-ssh-cleanup
    project-type: freestyle
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
    node: master
    display-name: 'CI clean stray ssh-agents on master'
    triggers:
        - timed : '@daily'
    wrappers:
        - timestamps
    builders:
        - shell: |
            #!/bin/bash -e
            pids=$(ps -eo pid,etime,comm,user,tty|grep ssh-agent |awk '$2~/-/ {if ($2>4) print $1}')
            [ -z "$pids" ] || kill $pids
    publishers:
        - email:
            recipients: 'linaro-infrastructure-errors@lists.linaro.org'