aboutsummaryrefslogtreecommitdiff
path: root/openembedded-x86-pre-built-images.yaml
blob: 50346199d3c12d6508e895a42cfabdb4d3e0e5fc (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
- job:
    name: openembedded-x86-pre-built-images
    project-type: matrix
    defaults: global
    logrotate:
        daysToKeep: 30
        numToKeep: 30
    parameters:
        - string:
            name: DEVICE_TYPE
            default: 'lng-x86'
        - string:
            name: LAVA_SERVER
            default: 'validation.linaro.org/RPC2/'
        - string:
            name: MACHINE
            default: 'lng-x86-64'
        - file:
            name: oe_pre-built_parameters
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
    disabled: false
    node: build
    child-workspace: .
    display-name: 'OpenEmbedded pre-built images (x86)'
    scm:
        - git:
            url: https://git.linaro.org/openembedded/jenkins-setup.git
            refspec: +refs/heads/master:refs/remotes/origin/master
            name: origin
            branches:
                - refs/heads/master
            skip-tag: true
            shallow-clone: true
            wipe-workspace: false
    axes:
        - axis:
            type: slave
            name: label
            values:
                - build
        - axis:
            type: user-defined
            name: gcc_version
            values:
                - 4.9
    execution-strategy:
        sequential: true
    wrappers:
        - timestamps
        - matrix-tie-parent:
            node: build
    builders:
        - linaro-publish-token
        - shell: |
            #!/bin/bash

            set -x

            export PATH="$HOME/bin:$PATH"

            # we clean build and populate it from cache
            bash -x pre-build-do-cleanup.sh

            # do a build
            bash -x init-and-build.sh -a x86 -g ${gcc_version} virtual/kernel

            cd ${WORKSPACE}

            bash -x post-build-create-image-manifest.sh
            bash -x post-build-sort-out-downloads.sh

            # Capture what we're building in the build output.
            repo manifest -r

            case "${linux_kernel}" in
              linaro-lng-x86-64)
                BUNDLE_STREAM_NAME="/public/team/linaro/ci-linux-lng/"
                ;;
              linux-lng-test-x86-64)
                BUNDLE_STREAM_NAME="/public/team/linaro/ci-linux-lng-pre-merge/"
                ;;
              linaro-lng-rt-x86-64)
                BUNDLE_STREAM_NAME="/public/team/linaro/ci-linux-lng-preempt-rt/"
                ;;
              linux-lng-rt-test-x86-64)
                BUNDLE_STREAM_NAME="/public/team/linaro/ci-linux-lng-preempt-rt-pre-merge/"
                ;;
            esac

            KERNEL_URL="http://snapshots.linaro.org/openembedded/pre-built/${linux_kernel}-${linux_kernel_version}/${BUILD_NUMBER}/$(ls ${WORKSPACE}/out/bzImage*.bin |xargs basename)"

            cat << EOF > post_build_lava_parameters
            DEVICE_TYPE=${DEVICE_TYPE}
            BUNDLE_STREAM_NAME=${BUNDLE_STREAM_NAME}
            LAVA_SERVER=${LAVA_SERVER}
            KERNEL_URL=${KERNEL_URL}
            EOF
        - inject:
            properties-file: post_build_lava_parameters
        - shell: |
            export ROOTFS_BUILD_NUMBER=121
            export ROOTFS_BUILD_URL="http://releases.linaro.org/15.06/openembedded/images/lng-x86/linaro-image-lng-qemux86-20150618-121.rootfs.cpio.gz"

            # Parse recipe and get GIT_URL/GIT_BRANCH/GIT_COMMIT
            export GIT_URL=$(grep "^SRC_URI =" meta-linaro/meta-linaro/recipes-kernel/linux/${linux_kernel}_${linux_kernel_version}.bb | cut -d'"' -f2 | cut -d';' -f1)
            export GIT_BRANCH=$(grep "^SRC_URI =" meta-linaro/meta-linaro/recipes-kernel/linux/${linux_kernel}_${linux_kernel_version}.bb |cut -d'"' -f2 | cut -d'=' -f2)
            (cd /mnt/ci_build/workspace/downloads/git2/git.linaro.org.kernel.linux-linaro-lng.git && export GIT_COMMIT=$(git rev-parse ${GIT_BRANCH}))

            mkdir -p out/lava
            rm -rf configs lci-build-tools
            git clone --depth 1 http://git.linaro.org/ci/lci-build-tools.git
            git clone --depth 1 http://git.linaro.org/ci/job/configs.git

            ./lci-build-tools/yaml-to-json.py configs/openembedded-x86-pre-built-images/lava-job-definitions/${DEVICE_TYPE}/template.yaml > out/lava/template.json
            ./lci-build-tools/yaml-to-json.py configs/openembedded-x86-pre-built-images/lava-job-definitions/${DEVICE_TYPE}/template-base.yaml > out/lava/template-base.json
            ./lci-build-tools/yaml-to-json.py configs/openembedded-x86-pre-built-images/lava-job-definitions/${DEVICE_TYPE}/template-benchmark.yaml > out/lava/template-benchmark.json
            ./lci-build-tools/yaml-to-json.py configs/openembedded-x86-pre-built-images/lava-job-definitions/${DEVICE_TYPE}/template-cyclic.yaml > out/lava/template-cyclic.json

            # Publish to snapshots
            test -d ${HOME}/bin || mkdir ${HOME}/bin
            wget https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O ${HOME}/bin/linaro-cp.py
            time python ${HOME}/bin/linaro-cp.py out openembedded/pre-built/${linux_kernel}-${linux_kernel_version}/${BUILD_NUMBER}
            #time python ${HOME}/bin/linaro-cp.py downloads openembedded/sources
            python ${HOME}/bin/linaro-cp.py --make-link openembedded/pre-built/${linux_kernel}-${linux_kernel_version}/${BUILD_NUMBER}
        - conditional-step:
            condition-kind: strings-match
            condition-string1: '${ENV,var="linux_kernel"}'
            condition-string2: 'linaro-lng-x86-64'
            steps:
                - trigger-builds:
                    - project: 'openembedded-lng-x86-pre-built-test-definitions'
                      block: true
        - conditional-step:
            condition-kind: strings-match
            condition-string1: '${ENV,var="linux_kernel"}'
            condition-string2: 'linaro-lng-rt-x86-64'
            steps:
                - trigger-builds:
                    - project: 'openembedded-lng-rt-x86-pre-built-test-definitions'
                      block: true
        - conditional-step:
            condition-kind: strings-match
            condition-string1: '${ENV,var="linux_kernel"}'
            condition-string2: 'linaro-lng-test-x86-64'
            steps:
                - trigger-builds:
                    - project: 'openembedded-lng-x86-pre-built-pre-merge-test-definitions'
                      block: true
        - conditional-step:
            condition-kind: strings-match
            condition-string1: '${ENV,var="linux_kernel"}'
            condition-string2: 'linaro-lng-rt-test-x86-64'
            steps:
                - trigger-builds:
                    - project: 'openembedded-lng-rt-x86-pre-built-pre-merge-test-definitions'
                      block: true
    publishers:
        - email:
            recipients: 'anders.roxell@linaro.org fathi.boudra@linaro.org koen.kooi@linaro.org riku.voipio@linaro.org'