aboutsummaryrefslogtreecommitdiff
path: root/linaro-edk2-prep-matrix.yaml
blob: 71a6d930e63efd398eef2ae14e5e6844b7b76085 (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
176
177
178
179
180
181
182
183
184
185
- job:
    name: linaro-edk2-prep-matrix
    project-type: matrix
    defaults: global
    logrotate:
        daysToKeep: 30
        numToKeep: 30
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
                - job-workspace
            linaro:
                - job-read
                - job-extended-read
                - job-build
                - job-cancel
    disabled: false
    node: build
    child-workspace: .
    display-name: 'Linaro EDK II - UEFI Continuous Integration (pre-release) - Matrix'
#    scm:
#        - git:
#            url: http://git.linaro.org/git/uefi/linaro-edk2.git
#            refspec: +refs/heads/release-prep:refs/remotes/origin/release-prep
#            name: origin
#            branches:
#                - refs/heads/release-prep
#            basedir: linaro-edk2
#            skip-tag: true
#            shallow-clone: true
#            clean: true
#            wipe-workspace: false
#    triggers:
#        - pollscm: 'H/5 * * * *'
    axes:
        - axis:
            type: user-defined
            name: MX_B
            values:
                - qemu64
                - qemu
                - fvp-foundation-armbds
#                - juno-armbds
#                - juno
#                - fvp-base-armbds
#                - mustang
#                - rtsm_a15mpcore-armbds
#                - tc2-armbds
#                - beagle-armbds
        - axis:
            type: user-defined
            name: MX_TYPE
            values:
                - RELEASE
                - DEBUG
        - axis:
            type: user-defined
            name: MX_TC
            values:

                - 48
                - 49
        - axis:
            type: slave
            name: label
            values:
                - docker-utopic
    execution-strategy:
        sequential: true
# Touchstone is used to build "most interesting" board first, and to also
# key actions that should only be done once per build (such as creating
# source tarball.
        touchstone:
            expr: 'MX_B=="qemu64" && MX_TYPE=="RELEASE" && MX_TC=="48"'
    wrappers:
        - timestamps
#        - build-name:
#            name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}'
        - matrix-tie-parent:
            node: build
    builders:
        - linaro-publish-token
        - shell: |
            #!/bin/bash

            export JOB_NAME=linaro-edk2-prep-matrix
            pwd
            echo "JOB_URL: ${JOB_URL}"
            echo "BUILD_URL: ${BUILD_URL}"
            echo "WORKSPACE: ${WORKSPACE}"

            set -ex

            sudo apt-get update
            sudo apt-get install -y acpica-tools python-pycurl zip
            wget --progress=dot -e dotbytes=2M http://ftp.de.debian.org/debian/pool/main/a/acpica-unix/acpica-tools_20150515-2_amd64.deb -O acpica-tools_20150515-2_amd64.deb
            sudo dpkg -i --force-all acpica-tools_*.deb
            rm -f acpica-tools_*.deb

            trap cleanup_exit INT TERM EXIT

            cleanup_exit()
            {
              cd ${WORKSPACE}
              rm -rf uefi-ci uefi-tools
              rm -rf ${JOB_NAME}-build
              rm -rf out
            }

            # Use pre-installed linaro toolchain
            [ ${MX_TC} == "48" ] && export PATH="${HOME}/srv/toolchain/arm-tc-14.04/bin:${HOME}/srv/toolchain/arm64-tc-14.04/bin:$PATH"
            [ ${MX_TC} == "49" ] && export PATH="${HOME}/srv/toolchain/arm-tc-15.02/bin:${HOME}/srv/toolchain/arm64-tc-15.02/bin:$PATH"

            git clone git://git.linaro.org/uefi/uefi-tools.git
            git clone git://git.linaro.org/people/roy.franz/uefi-ci.git -b rfranz-jenkins-test uefi-ci
            bash -x uefi-ci/uefi.sh

            builddir=${WORKSPACE}/${JOB_NAME}-build
            outdir=${WORKSPACE}/out

            rm -rf ${outdir}
            mkdir -p ${outdir}/gcc-${MX_TC}

            # move any *orig.tar.bz2 files separately to non-gcc based dir
            for f in ${builddir}/*orig.tar.bz2; do
                ## Check if the glob gets expanded to existing files.
                ## If not, f here will be exactly the pattern above
                ## and the exists test will evaluate to false.
                [ -e "$f" ]  || break  # No files exist, $f is glob pattern

                mv ${builddir}/*orig.tar.bz2 ${outdir}/
                break
            done
            mv ${builddir}/* ${outdir}/gcc-${MX_TC}
            find ${outdir}/ -name '*QEMU_EFI.fd' -exec bash -c 'in=${1}; out=${in%fd}img; cat $in /dev/zero | dd iflag=fullblock bs=1M count=64 of=$out; gzip -9 $out' _ {} \;

            cat << EOF > lava_job_definition_parameters
            find ${outdir}
            # Publish to snapshots
            wget https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O linaro-cp.py
            python ./linaro-cp.py --verbose --no-build-info out components/kernel/${JOB_NAME}/${BUILD_NUMBER}

        - inject:
            properties-file: lava_job_definition_parameters
        - shell: |
            #!/bin/bash

            # Test only valid for qemu64
            [ "${MX_B}" == "qemu64" ] || exit 0
            BUILD_TYPE=${MX_TYPE}|tr '[:upper:]' '[:lower:]'

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

            DEVICE_TYPE=kvm
            QEMU_EFI_URL=https://snapshots.linaro.org/components/kernel/${JOB_NAME}/${BUILD_NUMBER}/gcc-${MX_TC}/${BUILD_TYPE}/qemu64/QEMU_EFI.fd

            sed -e "s|\${BUILD_NUMBER}|${BUILD_NUMBER}|" \
                -e "s|\${BUILD_URL}|${BUILD_URL}|" \
                -e "s|\${BUNDLE_STREAM_NAME}|${BUNDLE_STREAM_NAME}|" \
                -e "s|\${QEMU_EFI_URL}|${QEMU_EFI_URL}|" \
                -e "s|\${INITRD_URL}|${INITRD_URL}|" \
                -e "s|\${STARTUP_NSH}|${STARTUP_NSH}|" \
                -e "s|\${DEVICE_TYPE}|${DEVICE_TYPE}|" \
                -e "s|\${GIT_BRANCH}|${GIT_BRANCH}|" \
                -e "s|\${GIT_COMMIT}|${GIT_COMMIT}|" \
                -e "s|\${GIT_URL}|${GIT_URL}|" \
                -e "s|\${IMAGE_URL}|${IMAGE_URL}|" \
                -e "s|\${LAVA_SERVER}|${LAVA_SERVER}|" \
                < configs/linaro-edk2-prep/lava-job-definitions/kvm/template-qemu-iscsi-in-kvm.json \
                > custom_lava_job_definition_qemu_iscsi_in_kvm.json

            cat << EOF > post_build_lava_parameters_qemu_iscsi_in_kvm
            DEVICE_TYPE=${DEVICE_TYPE}
            BUNDLE_STREAM_NAME=${BUNDLE_STREAM_NAME}
            CUSTOM_JSON_URL=${JOB_URL}ws/custom_lava_job_definition_qemu_iscsi_in_kvm.json

            LAVA_SERVER=${LAVA_SERVER}
            EOF
        - trigger-builds:
            - project: 'post-build-lava'
              property-file: post_build_lava_parameters_qemu_iscsi_in_kvm
              block: true