aboutsummaryrefslogtreecommitdiff
path: root/linaro-edk2-capsule.yaml
blob: ff0db6b3bef47ae1690d0f9b6bb603dfdafd1320 (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
- job:
    name: linaro-edk2-capsule
    project-type: freestyle
    defaults: global
    logrotate:
        daysToKeep: 30
        numToKeep: 30
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
                - job-workspace
    parameters:
        - password:
            name: PUBLISH_KEY
            default: ${PUBLISH_KEY}
        - string:
            name: BUNDLE_STREAM_NAME
            default: '/private/team/linaro/leg-edk2/'
        - string:
            name: DEVICE_TYPE
            default: 'rtsm_fvp_base-aemv8a'
        - string:
            name: LAVA_SERVER
            default: 'validation.linaro.org/RPC2/'
    disabled: false
    node: build
    display-name: 'Linaro EDK II - Capsule'
    scm:
        - git:
            url: http://git.linaro.org/git/uefi/linaro-edk2.git
            refspec: +refs/heads/linaro-topic-capsule:refs/remotes/origin/linaro-topic-capsule
            name: origin
            branches:
                - origin/linaro-topic-capsule
            basedir: linaro-edk2
            skip-tag: true
            shallow-clone: true
            clean: true
            wipe-workspace: false
    triggers:
        - pollscm: 'H/5 * * * *'
    wrappers:
        - timestamps
        - copy-to-slave:
            includes:
                -  gcc-linaro-aarch64-linux-gnu-4.8-2014.04_linux.tar.xz
        - build-name:
            name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}'
    builders:
        - shell: |
            #!/bin/bash

            set -ex

            trap cleanup_exit INT TERM EXIT

            cleanup_exit()
            {
              cd ${WORKSPACE}
              rm -rf arm64-tc
              rm -rf arm-trusted-firmware
              rm -rf uefi-tools
              rm -rf out
            }

            # Install custom toolchain
            mkdir arm64-tc
            tar --strip-components=1 -C ${WORKSPACE}/arm64-tc -xf gcc-linaro-aarch64-linux-gnu-4.8-*_linux.tar.xz
            export PATH="${WORKSPACE}/arm64-tc/bin:$PATH"

            # Check out arm-trusted-firmware - at a locked-down known-good version
            git clone -b v1.0 --depth 1 https://github.com/ARM-software/arm-trusted-firmware.git

            git clone git://git.linaro.org/uefi/uefi-tools.git

            export AARCH64_TOOLCHAIN=GCC48
            export EDK2_DIR=${WORKSPACE}/linaro-edk2
            export UEFI_TOOLS_DIR=${WORKSPACE}/uefi-tools
            export JENKINS_WORKSPACE=${WORKSPACE}
            unset WORKSPACE

            cd ${EDK2_DIR}
            ${UEFI_TOOLS_DIR}/uefi-build.sh -b RELEASE -a ../arm-trusted-firmware fvp

            unset WORKSPACE
            export WORKSPACE=${JENKINS_WORKSPACE}

            cd ${WORKSPACE}
            mkdir out
            cp -a ${EDK2_DIR}/Build/ArmVExpress-FVP-AArch64/RELEASE_GCC48/FV/*.bin out/
            cp -a ${EDK2_DIR}/Build/ArmVExpress-FVP-AArch64/RELEASE_GCC48/FV/*.fd out/
            ${HOME}/bin/linaro-cp out components/kernel/${JOB_NAME}/${BUILD_NUMBER}

            IMAGE_BUILD_NUMBER=`wget -q --no-check-certificate -O - https://ci.linaro.org/jenkins/job/linux-leg/lastSuccessfulBuild/buildNumber`
            cat << EOF > lava_job_definition_parameters
            IMAGE_URL=http://snapshots.linaro.org/kernel-hwpack/linux-leg-vexpress64/${IMAGE_BUILD_NUMBER}/vexpress64-leg-sd.img.gz
            EOF
        - inject:
            properties-file: lava_job_definition_parameters
        - shell: |
            BL1_URL=https://snapshots.linaro.org/components/kernel/${JOB_NAME}/${BUILD_NUMBER}/bl1.bin
            FIP_URL=https://snapshots.linaro.org/components/kernel/${JOB_NAME}/${BUILD_NUMBER}/fip.bin

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

            sed -e "s|\${BUILD_NUMBER}|${BUILD_NUMBER}|" \
                -e "s|\${BUILD_URL}|${BUILD_URL}|" \
                -e "s|\${BUNDLE_STREAM_NAME}|${BUNDLE_STREAM_NAME}|" \
                -e "s|\${BL1_URL}|${BL1_URL}|" \
                -e "s|\${FIP_URL}|${FIP_URL}|" \
                -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-capsule/lava-job-definitions/${DEVICE_TYPE}/template.json \
                > custom_lava_job_definition.json

            cat << EOF > post_build_lava_parameters
            DEVICE_TYPE=${DEVICE_TYPE}
            BUNDLE_STREAM_NAME=${BUNDLE_STREAM_NAME}
            CUSTOM_JSON_URL=${JOB_URL}ws/custom_lava_job_definition.json
            LAVA_SERVER=${LAVA_SERVER}
            EOF
        - trigger-builds:
            - project: 'post-build-lava'
              property-file: post_build_lava_parameters
    publishers:
        - email:
            recipients: 'fathi.boudra@linaro.org'