aboutsummaryrefslogtreecommitdiff
path: root/tcwg-buildslave-command.yaml
blob: 51a753c535c572b3ce3fb4298c665e9501951578 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
- job:
    name: tcwg-buildslave-command
    project-type: matrix
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 30
    parameters:
        - string:
            name: machines_list
            default: 'dev-01.tcwglab'
            description: 'Machines to run on: r1-a7.aus-colo r1-a12.aus-colo apm-01.tcwglab apm-02.tcwglab test-armv8-01.tcwglab test-armv8-02.tcwglab tcwg-tx1-01.tcwglab tcwg-tx1-02.tcwglab build-01.tcwglab build-02.tcwglab build-03.tcwglab build-04.tcwglab build-05.tcwglab build-06.tcwglab build-07.tcwglab build-08.tcwglab dev-01.tcwglab dev-02.tcwglab bkp-01.tcwglab tcwg-ex40-01'
        - string:
            name: command
            default: 'ls $HOME/*'
            description: 'Command to run'
        - bool:
            name: dry_run
            default: 'false'
            description: 'Whether to do a dry-run'
    disabled: false
    node: tcwg-x86_64-dev-01
    concurrent: true
    display-name: 'TCWG CCC Buildslave command'
    axes:
        - axis:
            type: dynamic
            name: machine
            values:
                - machines_list
            description: 'SSH names of machines to run the command on'
        - axis:
            type: slave
            name: label
            values:
                - tcwg-x86_64-dev-01
    wrappers:
        - timeout:
            timeout: 60
        - timestamps
        - ssh-agent-credentials:
            # tcwg-buildslave user id
            users:
                - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
        - build-name:
            name: '#${BUILD_NUMBER}-${ENV,var="machines_list"}'
    builders:
        - shell: |
            #!/bin/bash

            set -ex

            cat > command.sh.$$$$ << EOF
            #!/bin/bash

            set -ex

            $command
            EOF
            chmod +x command.sh.$$$$

            cat command.sh.$$$$

            scp command.sh.$$$$ $machine:/tmp/
            # Don't use ssh shared connection to reliably proxy SSH agent
            $dry_run || ssh -Snone $machine /tmp/command.sh.$$$$