aboutsummaryrefslogtreecommitdiff
path: root/ledge-oe-premerge-ci.yaml
blob: 47527545591cc1f71c7d0fb2ab4bc0e07176e7e0 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
- job:
    name: ledge-oe-premerge-ci
    project-type: matrix
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
                - job-workspace
            linaro:
                - job-read
                - job-extended-read
                - job-build
                - job-cancel
        - github:
            url: https://github.com/Linaro/meta-ledge
    parameters:
        - string:
            name: IMAGES
            default: 'ledge-gateway ledge-iot ledge-gateway-lava ledge-iot-lava'
        - string:
            name: MANIFEST_BRANCH
            default: 'zeus'
        - string:
            name: PUB_DEST
            default: 'components/ledge/oe/pemerge-ci/${MACHINE}/${BUILD_NUMBER}/${DISTRO}'
        - string:
            name: LAVA_SERVER
            default: 'validation.linaro.org/RPC2/'
        - string:
            name: QA_SERVER
            default: 'https://qa-reports.linaro.org'
        - string:
            name: QA_SERVER_PROJECT
            default: 'ledge'
        - string:
            name: QA_SERVER_TEAM
            default: 'ledge'
        - string:
            name: AUTH_GROUPS
            default: 'linaro'
        - string:
            name: KERNEL_ARGS
            default: 'selinux=0'
    disabled: false
    node: master
    display-name: 'Pre merge CI for LEDGE OE build'
    scm:
        - git:
            url: https://github.com/Linaro/meta-ledge
            refspec: +refs/pull/*:refs/remotes/origin/pr/*
            name: origin
            branches:
                - ${sha1}
            skip-tag: true
            shallow-clone: true
            wipe-workspace: true
    triggers:
        - github-pull-request:
            github-hooks: true
            permit-all: true
            white-list-target-branches:
                - 'zeus'
            auth-id: 'GITHUB_TOKEN'
    axes:
        - axis:
            type: user-defined
            name: MACHINE
            values:
                - 'ledge-stm32mp157c-dk2'
                - 'ledge-qemux86-64'
                - 'ledge-qemuarm'
                - 'ledge-qemuarm64'
        - axis:
            type: user-defined
            name: DISTRO
            values:
                - rpb
        - axis:
            type: slave
            name: label
            values:
                - docker-stretch-amd64
    execution-strategy:
        sequential: false
    wrappers:
        - timeout:
            timeout: 180
        - timestamps
        - ssh-agent-credentials:
            users:
                - 'OE_COMMIT_BOT_KEY'
        - credentials-binding:
            - text:
                credential-id: QA_REPORTS_TOKEN
                variable: QA_REPORTS_TOKEN
    builders:
        - shell: |
            #!/bin/bash

            # Mapping for MACHINE -> DEVICE_TYPE
            case "${MACHINE}" in
              ledge-ti-am572x)
                DEVICE_TYPE=x15
                ;;
              ledge-qemux86-64)
                DEVICE_TYPE=qemux86_64uefi
                ;;
              ledge-qemuarm)
                DEVICE_TYPE=qemuarmuefi
                ;;
              ledge-qemuarm64)
                DEVICE_TYPE=qemuarm64uefi
                ;;
              ledge-synquacer)
                DEVICE_TYPE=synquacer
                ;;
              ledge-stm32mp157c-dk2)
                DEVICE_TYPE=stm32mp157c-dk2
                ;;
              *)
                echo "Skip DEVICE_TYPE for ${MACHINE}"
                ;;
            esac

            echo "DEVICE_TYPE=${DEVICE_TYPE}" > device_type_parameters
        - inject:
            properties-file: device_type_parameters
        - shell:
            !include-raw: ledge/oe/builders.sh
        - inject:
            properties-file: post_build_lava_parameters
        - linaro-publish-token
        - shell:
            !include-raw: rpb-openembedded/buildinfo-protected.sh
        - shell:
            !include-raw: rpb-openembedded/publishers.sh
        - shell: |
            if [ ${MACHINE} = "am57xx-evm" ]; then
                   export LAVA_SERVER="validation.linaro.org/RPC2/"
            fi

            [ -z "${KSELFTEST_PATH}" ] && export KSELFTEST_PATH="/opt/kselftests/mainline/"
            [ -z "${LAVA_JOB_PRIORITY}" ] && export LAVA_JOB_PRIORITY="25"
            [ -z "${SANITY_LAVA_JOB_PRIORITY}" ] && export SANITY_LAVA_JOB_PRIORITY="30"
            [ -z "${SKIP_LAVA}" ] || unset DEVICE_TYPE
            [ -z "${QA_SERVER_TEAM}" ] && export QA_SERVER_TEAM=rpb
            [ -z "${TOOLCHAIN}" ] && export TOOLCHAIN="unknown"
            [ -z "${TDEFINITIONS_REVISION}" ] && export TDEFINITIONS_REVISION="kselftest-5.1"
            [ -z "${MANIFEST_COMMIT}" ] && export MANIFEST_COMMIT="HEAD"
            # Used by DB410C's template:
            export RESIZE_ROOTFS=${RESIZE_ROOTFS:-}

            rm -rf configs
            git clone --depth 1 http://git.linaro.org/ci/job/configs.git

            [ -z "${DEVICE_TYPE}" ] || \
                  python configs/openembedded-lkft/submit_for_testing.py \
                     --device-type ${DEVICE_TYPE} \
                     --build-number ${BUILD_NUMBER} \
                     --lava-server ${LAVA_SERVER} \
                     --qa-server ${QA_SERVER} \
                     --qa-server-team ${QA_SERVER_TEAM} \
                     --qa-server-project ${QA_SERVER_PROJECT} \
                     --git-commit ${MANIFEST_COMMIT} \
                     --template-path configs/rpb-openembedded/lava-job-definitions \
                     --template-names template-boot.yaml
    publishers:
        - groovy-postbuild:
            script:
                !include-raw:
                  - openembedded-lkft/postbuild.groovy
        - email:
            recipients: 'maxim.uvarov@linaro.org ilias.apalodimas@linaro.org christophe.priouzeau@linaro.org'