blob: f60a19f2ffd913b8539ae6d7fff9cda1c0ac923f [file] [log] [blame]
Bernhard Rosenkränzer1ca8d242016-07-09 16:31:30 +02001- job:
2 name: android-gcc-toolchain
3 project-type: freestyle
4 defaults: global
5 properties:
6 - authorization:
7 anonymous:
8 - job-read
9 - job-extended-read
Benjamin Copeland9dc2eb82022-10-11 12:40:33 +010010 everyone-flat:
Bernhard Rosenkränzer1ca8d242016-07-09 16:31:30 +020011 - job-read
12 - job-extended-read
13 - job-build
14 - job-cancel
15 - build-discarder:
16 days-to-keep: 60
17 num-to-keep: 60
18 artifact-num-to-keep: 1
19 parameters:
20 - string:
21 name: GCCVER
22 default: '6.1.0'
23 description: 'GCC version (e.g. x.y.z or x.y-YYYY.MM for TCWG releases)'
Riku Voipiob7c49aa2020-12-01 15:15:24 +020024 disabled: true
Vishal Bhoj902a7942018-04-14 12:08:04 +053025 node: docker-xenial-aosp
Bernhard Rosenkränzer1ca8d242016-07-09 16:31:30 +020026 display-name: 'GCC based AOSP toolchain'
27 triggers:
28 - gerrit:
29 server-name: __ANY__
30 trigger-on:
31 - change-merged-event
32 projects:
33 - project-compare-type: 'PLAIN'
34 project-pattern: 'people/bernhard.rosenkranzer/android-ndk-build'
35 branches:
36 - branch-compare-type: 'PLAIN'
37 branch-pattern: 'master'
38 file-paths:
39 - compare-type: 'PLAIN'
40 pattern: 'init-and-build.sh'
41 wrappers:
42 - timestamps
43 - timeout:
44 timeout: 500
45 scm:
46 - git:
47 url: https://git.linaro.org/people/bernhard.rosenkranzer/android-ndk-build.git
48 refspec: +refs/heads/master:refs/remotes/origin/master
49 name: origin
50 branches:
51 - refs/heads/master
52 basedir: android-ndk-build
53 skip-tag: true
54 shallow-clone: true
55 clean:
56 after: true
57 wipe-workspace: false
58 builders:
59 - linaro-publish-token
60 - shell: |
61 #!/bin/bash
62
63 # Install build dependencies
64 sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
65 sudo apt-get update
66 sudo apt-get install -y \
67 autoconf automake bash bison build-essential bzip2 chrpath \
68 coreutils cpio flex g++ gawk gcc git gzip libffi-dev libncurses5-dev \
Fathi Boudra5fe938e2016-12-11 11:34:29 +020069 make realpath sed tar texi2html texinfo unzip wget python-requests
Bernhard Rosenkränzer1ca8d242016-07-09 16:31:30 +020070
71 test -d ${HOME}/bin || mkdir -p ${HOME}/bin
72 curl https://storage.googleapis.com/git-repo-downloads/repo > ${HOME}/bin/repo
73 chmod a+x ${HOME}/bin/repo
74 export PATH=${HOME}/bin:${PATH}
75
76 # Set some reasonable defaults
77 git config --global user.email "ci_notify@linaro.org"
78 git config --global user.name "Linaro CI"
79
80 # Set up our build environment
81 cd ${WORKSPACE}/android-ndk-build
82 GCCVER=${GCCVER} OURDIR="${WORKSPACE}/android-ndk-build" ./init-and-build.sh 2>&1 |tee ${WORKSPACE}/build.log || :
Bernhard Rosenkränzer1ca8d242016-07-09 16:31:30 +020083 if [ ! -e ${WORKSPACE}/android-ndk-build/ndk/out/dist/gcc-arm-linux-x86_64.tar.bz2 ]; then
84 echo "ARMv7 crosscompiler failed to build"
85 exit 1
86 fi
87 if [ ! -e ${WORKSPACE}/android-ndk-build/ndk/out/dist/gcc-arm64-linux-x86_64.tar.bz2 ]; then
88 echo "ARMv8 crosscompiler failed to build"
89 exit 1
90 fi
91
92 # Let's save some space and assign better filenames
93 cd ${WORKSPACE}/android-ndk-build/ndk/out/dist
94 bunzip2 gcc-arm-linux-x86_64.tar.bz2
95 mv gcc-arm-linux-x86_64.tar gcc-${GCCVER}-arm-linux-x86_64.tar
96 bunzip2 gcc-arm64-linux-x86_64.tar.bz2
97 mv gcc-arm64-linux-x86_64.tar gcc-${GCCVER}-arm64-linux-x86_64.tar
98 xz -9ef *.tar
99 # And remove stuff we don't need
100 rm -rf *.tar.bz2 *.zip logs
101
102 # Publish
103 wget -q https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O ${HOME}/bin/linaro-cp.py
Benjamin Copeland6f81d052019-11-05 14:45:47 +0000104 time python3 ${HOME}/bin/linaro-cp.py \
Bernhard Rosenkränzer1ca8d242016-07-09 16:31:30 +0200105 --api_version 3 \
106 --link-latest \
107 ${WORKSPACE}/android-ndk-build/ndk/out/dist android/${JOB_NAME}/${BUILD_NUMBER}
108 publishers:
109 - archive:
110 artifacts: '*.log'
111 - email:
112 recipients: 'bernhard.rosenkranzer@linaro.org'