aboutsummaryrefslogtreecommitdiff
path: root/tcwg-shell-scripts-sanity-check.yaml
blob: ebda7b8779cc8c136196a26ccb177d46b6b94cf4 (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
- job:
    name: tcwg-shell-scripts-sanity-check
    project-type: freestyle
    defaults: global
    logrotate:
        daysToKeep: 30
        numToKeep: 30
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
    disabled: false
    node: tcwg-x86_64-build
    display-name: 'TCWG shell scripts sanity check'
    scm:
        # Get a stable copy of the check script
        - git:
            url: https://git.linaro.org/toolchain/jenkins-scripts.git
            branches:
                - origin/master
            basedir: jenkins-scripts-master
        # Then this is what we're actually checking
        # (which might also be jenkins-scripts, but Gerrit's version)
        - git:
            url: https://review.linaro.org/${GERRIT_PROJECT}
            refspec: ${GERRIT_REFSPEC}
            branches:
                - ${GERRIT_BRANCH}
            skip-tag: true
            clean:
                before: true
            choosing-strategy: gerrit
            basedir: ${GERRIT_PROJECT}
    triggers:
        - gerrit:
            server-name: 'review.linaro.org'
            trigger-on:
                - patchset-created-event:
                    exclude-drafts: true
            projects:
                - project-compare-type: 'REG_EXP'
                  project-pattern: 'toolchain\/(jenkins-scripts|bmk-scripts)'
                  branches:
                    - branch-compare-type: 'PLAIN'
                      branch-pattern: 'master'
    wrappers:
        - timestamps
        - build-name:
            name: '#${BUILD_NUMBER}-${GERRIT_PROJECT}'
        - ssh-agent-credentials:
            # tcwg-buildslave user id
            users:
                - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
    builders:
        - shell:
            command: |
                #!/bin/bash
                set -ex

                # Shellcheck source= directives are relative to
                # the CWD, so run from inside the folder.
                # GERRIT_PROJECT is for example toolchain/jenkins-scripts
                cd ${GERRIT_PROJECT}
                ../../jenkins-scripts-master/docker-run.sh --distro lts -- ../../jenkins-scripts-master/sanity-check.sh
            # Aka some files had issues
            # Any other non-zero means we called shellcheck incorrectly
            unstable-return: 1