aboutsummaryrefslogtreecommitdiff
path: root/lkft-aosp.yaml
blob: 7caf2f73398a007f59aea57f31c091560800404c (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
- job:
    name: lkft-aosp
    project-type: freestyle
    defaults: global
    logrotate:
        daysToKeep: 60
        numToKeep: 60
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            everyone-flat:
                - job-build
                - job-cancel
    parameters:
        - string:
            name: ANDROID_BUILD_CONFIG
            default: ''
        - string:
            name: KERNEL_BUILD_CONFIG
            default: ''
        - string:
            name: MANIFEST_BRANCH
            default: ''
        - string:
            name: TARGET_PRODUCT
            default: ""
    disabled: false
    node: docker-focal-aosp
    display-name: 'Jobs for pure aosp builds'
    concurrent: true
    wrappers:
        - timestamps
        - build-name:
            name: '#${BUILD_NUMBER}${PROPFILE,file="wrappers_parameters",property="WRAPPER_BUILD_NAME"}'
        - timeout:
            timeout: 900
        # needed to publish to snapshots
        - credentials-binding:
            - text:
                credential-id: snapshots-api-key
                variable: PUBLISH_KEY
    builders:
        - shell: |
            #!/bin/bash -ex

            sudo apt-get update
            # Here is for packages not listed by the source.android.com site below.
            # But the following packages might not be really necessary,
            # as the docker image for docker-focal-aosp labelled nodes is linaro/jenkins-amd64-ubuntu:focal
            # which is defined here: https://git.linaro.org/infrastructure/ci-yadp-builder.git/tree/docker_templates_aosp_amd64.yml#n2
            # And the packages listed here might be already defined there.
            sudo apt-get install -y --allow-change-held-packages wget sudo python3 python-is-python3 openjdk-11-jdk-headless
            java -version

            ## https://source.android.com/docs/setup/start/requirements#hardware-requirements
            sudo apt-get install -y --allow-change-held-packages git-core gnupg flex bison build-essential zip curl zlib1g-dev libc6-dev-i386 libncurses5 x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig

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

            git config --global user.email "ci_notify@linaro.org"
            git config --global user.name "Linaro CI"

            # set value for the build name
            if [ -n "${ANDROID_BUILD_CONFIG}" ]; then
                WRAPPER_BUILD_NAME="-${ANDROID_BUILD_CONFIG}"
            elif [ -n "${MANIFEST_BRANCH}" ] && [ -n "${TARGET_PRODUCT}" ]; then
                WRAPPER_BUILD_NAME="-${MANIFEST_BRANCH}-${TARGET_PRODUCT}"
            fi
            echo "WRAPPER_BUILD_NAME=${WRAPPER_BUILD_NAME}" > wrappers_parameters

        - shell:
            !include-raw:
                - lkft/common/build-aosp.sh
        - inject:
            properties-file: publish_parameters
        - linaro-publish-token
        - shell:
            !include-raw:
                - android/linaro-publisher.sh
        - shell: |
            #!/bin/bash -ex
            BUILD_ROOT="${BUILD_ROOT:-/home/buildslave/srv/aosp-public}"

            rm -fr "${BUILD_ROOT}/build/aosp-${BUILD_NUMBER}"
            rm -fr "${BUILD_ROOT}/build/kernel-${BUILD_NUMBER}"
            rm -fr "${BUILD_ROOT}/dist-${BUILD_NUMBER}"
    publishers:
        - archive:
            artifacts: '*.xml,*.json'
            latest-only: true
        - logparser:
            parse-rules: '/var/jenkins_home/userContent/android.parse'
            unstable-on-warning: false
            fail-on-error: false
        - fingerprint:
            files: 'build/fingerprints/*'
        - email:
            recipients: 'yongqin.liu@linaro.org sumit.semwal@linaro.org'