aboutsummaryrefslogtreecommitdiff
path: root/ynk-lhg-oe-build-next.yaml
blob: 1a37cc7e095f9e7aeaaa26996104995336b82ece (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
- job:
    name: ynk-lhg-oe-build-next
    project-type: matrix
    defaults: global
    logrotate:
        daysToKeep: 30
        numToKeep: 30
        artifactNumToKeep: 1
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
                - job-workspace
            linaro:
                - job-build
                - job-cancel
    parameters:
        - string:
            name: MANIFEST_BRANCH
            default: 'krogoth.lhg'
        - string:
            name: DISTRO
            default: 'rpb-wayland'
        - string:
            name: image_type
            default: 'rpb-weston-image'
    disabled: false
    node: lhg
    display-name: 'LHG rpb-based build (next)'
    axes:
        - axis:
            type: slave
            name: label
            values:
                - lhg
        - axis:
            type: user-defined
            name: MACHINE
            values:
                - dragonboard-410c
                - hikey
    execution-strategy:
        sequential: true
    wrappers:
        - timestamps
        - matrix-tie-parent:
            node: lhg
    builders:
        - shell: |
            #!/bin/bash

            # workaround EDK2 is confused by the long path used during the build
            # and truncate files name expected by VfrCompile
            DIR_FOR_WORK=${HOME}/`dirname ${JOB_NAME}`
            mkdir -p ${DIR_FOR_WORK}
            cd ${DIR_FOR_WORK}

            set -x

            trap cleanup_exit INT TERM EXIT

            cleanup_exit()
            {
                echo "Running cleanup_exit..."
            }

            mkdir -p ${HOME}/bin
            curl https://storage.googleapis.com/git-repo-downloads/repo > ${HOME}/bin/repo
            chmod a+x ${HOME}/bin/repo
            export PATH=${HOME}/bin:${PATH}

            # initialize repo if not done already
            if [ ! -e ".repo/manifest.xml" ]; then
               repo init -u https://github.com/andrey-konovalov/oe-rpb-manifest.git -b ${MANIFEST_BRANCH} -m default.xml
               mkdir -p build
            fi

            repo sync
            cp .repo/manifest.xml source-manifest.xml
            repo manifest -r -o pinned-manifest.xml

            # the setup-environment will create local.conf, make sure we get rid
            # of old config. Let's remove the previous TMPDIR as well. We want
            # to preserve build/buildhistory though.
            rm -rf build/conf build/tmp-*glibc/

            # Accept EULA if/when needed
            export EULA_dragonboard410c=1
            source setup-environment build

            bitbake ${image_type}
            DEPLOY_DIR_IMAGE=$(bitbake -e | grep "^DEPLOY_DIR_IMAGE="| cut -d'=' -f2 | tr -d '"')

            # Prepare files to archive
            rm -f ${DEPLOY_DIR_IMAGE}/*.txt
            find ${DEPLOY_DIR_IMAGE} -type l -delete
            mv ${DIR_FOR_WORK}/{source,pinned}-manifest.xml ${DEPLOY_DIR_IMAGE}

            # Create MD5SUMS file
            (cd ${DEPLOY_DIR_IMAGE} && md5sum * > MD5SUMS.txt)

            # Just archive some of the build artifacts - don't publish anything
            # for now.
            #
            # The archive publisher can't handle files located outside
            # ${WORKSPACE} - copy the artifacts there before archiving.
            rm -rf ${WORKSPACE}/out
            mkdir ${WORKSPACE}/out
            cp ${DEPLOY_DIR_IMAGE}/*rootfs.ext4.gz ${WORKSPACE}/out
            cp ${DEPLOY_DIR_IMAGE}/*manifest* ${WORKSPACE}/out
            cp ${DEPLOY_DIR_IMAGE}/MD5SUMS.txt ${WORKSPACE}/out
            cp ${DEPLOY_DIR_IMAGE}/boot--*.img ${WORKSPACE}/out || true
    publishers:
        - archive:
            artifacts: 'out/*'
        - email:
            recipients: 'andrey.konovalov@linaro.org'