aboutsummaryrefslogtreecommitdiff
path: root/ynk-lhg-oe-build-next.yaml
blob: 6e9b91cef7d1fe0ca00c48c15a4e37d3d9ec5f48 (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
- 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
                - job-configure
    parameters:
        - string:
            name: MANIFEST_BRANCH
            default: 'krogoth-staging'
        - string:
            name: DISTRO
            default: 'rpb-wayland'
        - string:
            name: image_type
            default: 'rpb-westonchromium-image'
    disabled: false
    node: lhg
    display-name: 'LHG rpb-based build (staging)'
    axes:
        - axis:
            type: slave
            name: label
            values:
                - lhg
        - axis:
            type: user-defined
            name: MACHINE
            values:
                - dragonboard-410c
                - hikey
                - am57xx-evm
    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 -ex

            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
            rm -rf .repo bitbake layers
            repo init -u https://github.com/andrey-konovalov/oe-rpb-manifest.git -b ${MANIFEST_BRANCH} -m default.xml
            mkdir -p build

            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 conf 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} - create the link before archiving.
            rm -f ${WORKSPACE}/out
            ln -s ${DEPLOY_DIR_IMAGE} ${WORKSPACE}/out
        - linaro-publish-token
        - shell: |
            #!/bin/bash

            # Publish
            test -d ${HOME}/bin || mkdir ${HOME}/bin
            wget -q 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 \
              --server ${PUBLISH_SERVER} \
              --link-latest \
              --verbose --dry-run \
              ${DEPLOY_DIR_IMAGE}/ \
              openembedded/pre-built/lhg/${MANIFEST_BRANCH}/${MACHINE}/${DISTRO}/${BUILD_NUMBER}
    publishers:
        - archive:
            artifacts: 'out/*'
        - email:
            recipients: 'andrey.konovalov@linaro.org'