aboutsummaryrefslogtreecommitdiff
path: root/openembedded-lkft-linux-generic.yaml
blob: 56dfc7d104c7f00c31f9d0ca4c8cedb6afa337e4 (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
- job:
    name: openembedded-lkft-linux-generic
    project-type: freestyle
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-read
                - job-extended-read
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 30
            artifact-num-to-keep: 1
    parameters:
        - string:
            name: KERNEL_REPO
            default: 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git'
            description: |
                <b>[MANDATORY]</b> Kernel repository URL
        - string:
            name: KERNEL_BRANCH
            default: 'master'
            description: |
                <b>[MANDATORY]</b> Kernel branch
        - choice:
            name: KERNEL_ARCH
            choices:
                - 'arm64'
                - 'arm'
                - 'x86'
            description: |
                <b>[MANDATORY]</b> Kernel architecture
        - string:
            name: KERNEL_CONFIG
            default: 'defconfig'
            description: |
                <b>[OPTIONAL]</b> Kernel config<br>
                If ommited the default kernel config will use<br>
                  - defconfig on arm64<br>
                  - multi_v7_defconfig on arm<br>
                  - x86_64_defconfig on x86<br>
                Note: an additional config fragment is added to ensure systemd is functional
        - string:
            name: KERNEL_COMMIT
            default: ''
            description: |
                <b>[OPTIONAL]</b> Kernel commit<br>
                If ommited TIP will be used<br>
                e.g.: 0adb32858b0bddf4ada5f364a84ed60b196dbcda
        - string:
            name: PUB_DEST
            default: 'openembedded/lkft/rocko/generic/rpb/linux-custom/${BUILD_NUMBER}'
            description: |
                <b>[MANDATORY]</b> Publishing destination path on https://snapshots.linaro.org
# FIXME we don't submit LAVA jobs for now
#        - string:
#            name: QA_SERVER
#            default: 'https://qa-reports.linaro.org'
#        - string:
#            name: QA_SERVER_PROJECT
#            default: 'linux-custom-oe'
        - bool:
            name: SKIP_LAVA
            default: 'true'
    disabled: false
    node: docker-lkft
    display-name: 'LKFT - Linux Generic/Custom kernel builder (OpenEmbedded/rocko)'
    wrappers:
        - timeout:
            timeout: 180
        - timestamps
#        - credentials-binding:
#            - text:
#                credential-id: QA_REPORTS_TOKEN
#                variable: QA_REPORTS_TOKEN
    builders:
        - shell: |
            #!/bin/bash -e

            # Mapping for ARCH -> MACHINE/DEVICE_TYPE
            # Set a default config if it isn't given
            case "${KERNEL_ARCH}" in
              arm64)
                MACHINE=juno
                DEVICE_TYPE=juno-r2
                [ -z "${KERNEL_CONFIG}" ] && KERNEL_CONFIG=defconfig
                ;;
              arm)
                MACHINE=am57xx-evm
                DEVICE_TYPE=x15
                [ -z "${KERNEL_CONFIG}" ] && KERNEL_CONFIG=multi_v7_defconfig
                ;;
              x86)
                MACHINE=intel-core2-32
                DEVICE_TYPE=x86
                [ -z "${KERNEL_CONFIG}" ] && KERNEL_CONFIG=x86_64_defconfig
                ;;
            esac

            # Determine the kernel commit if it isn't given
            [ -z "${KERNEL_COMMIT}" ] && KERNEL_COMMIT=$(git ls-remote --heads ${KERNEL_REPO} ${KERNEL_BRANCH} | cut -f1)

            cat << EOF > ${WORKSPACE}/custom-kernel-info.inc.tmp
            KERNEL_COMMIT = "${KERNEL_COMMIT}"
            KERNEL_REPO = "${KERNEL_REPO/http*:/git:}"
            KERNEL_BRANCH = "${KERNEL_BRANCH}"
            KERNEL_CONFIG_aarch64 = "${KERNEL_CONFIG}"
            KERNEL_CONFIG_arm = "${KERNEL_CONFIG}"
            KERNEL_CONFIG_x86-64 = "${KERNEL_CONFIG}"
            EOF

            echo "IMAGES=rpb-console-image-lkft" > parameters
            echo "MANIFEST_URL=https://github.com/96boards/oe-rpb-manifest.git" >> parameters
            echo "MANIFEST_BRANCH=rocko" >> parameters
            echo "DISTRO=rpb" >> parameters
            echo "MACHINE=${MACHINE}" >> parameters
            echo "DEVICE_TYPE=${DEVICE_TYPE}" >> parameters
            echo "KERNEL_RECIPE=linux-generic" >> parameters
            cat parameters

            echo "#${BUILD_NUMBER}-${KERNEL_COMMIT:0:8}" > ${WORKSPACE}/version.txt
        - build-name-setter:
            name: 'version.txt'
            file: true
        - inject:
            properties-file: parameters
        - shell:
            !include-raw: openembedded-lkft/builders-generic.sh
        - inject:
            properties-file: post_build_lava_parameters
        - linaro-publish-token
        - shell:
            !include-raw: openembedded-lkft/publishers.sh
    publishers:
        - groovy-postbuild:
            script:
                !include-raw:
                  - rpb-openembedded/postbuild.groovy