blob: e4737131360e656c180d4911119d0833f77b9c8c (
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
- job:
name: android-lcr-member-vexpress-m
project-type: freestyle
defaults: global
logrotate:
daysToKeep: 60
numToKeep: 60
properties:
- authorization:
anonymous:
- job-read
linaro:
- job-build
- job-cancel
parameters:
- password:
name: PRIVATE_KEY
default: ${PRIVATE_KEY}
disabled: true
node: docker-utopic-aosp
display-name: 'Versatile Express - Member LCR Android M Build'
concurrent: true
triggers:
- gerrit:
trigger-on:
- change-merged-event
projects:
- project-compare-type: 'PLAIN'
project-pattern: 'android-patchsets'
branches:
- branch-compare-type: 'PLAIN'
branch-pattern: 'master'
- project-compare-type: 'PLAIN'
project-pattern: 'device/linaro/common'
branches:
- branch-compare-type: 'PLAIN'
branch-pattern: 'linaro-marshmallow'
- project-compare-type: 'PLAIN'
project-pattern: 'android/device/linaro/vexpress'
branches:
- branch-compare-type: 'PLAIN'
branch-pattern: 'linaro-marshmallow'
- project-compare-type: 'PLAIN'
project-pattern: 'linaro-art/platform/manifest'
branches:
- branch-compare-type: 'PLAIN'
branch-pattern: 'linaro-marshmallow'
- project-compare-type: 'PLAIN'
project-pattern: 'linaro-art/platform/build'
branches:
- branch-compare-type: 'PLAIN'
branch-pattern: 'lor-marshmallow'
- project-compare-type: 'PLAIN'
project-pattern: 'linaro-art/platform/art'
branches:
- branch-compare-type: 'PLAIN'
branch-pattern: 'lor-marshmallow'
- project-compare-type: 'PLAIN'
project-pattern: 'linaro-art/platform/external/vixl'
branches:
- branch-compare-type: 'PLAIN'
branch-pattern: 'lor-marshmallow'
- project-compare-type: 'PLAIN'
project-pattern: 'android-build-configs'
branches:
- branch-compare-type: 'PLAIN'
branch-pattern: 'master'
file-paths:
- compare-type: 'PLAIN'
pattern: 'lcr-member-vexpress-m'
wrappers:
- timestamps
- timeout:
timeout: 500
builders:
- linaro-publish-token
- shell: |
#!/bin/bash
trap cleanup_exit INT TERM EXIT
cleanup_exit()
{
kill -9 ${SSH_AGENT_PID}
}
java -version
sudo add-apt-repository ppa:linaro-maintainers/tools
sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y bison git gperf libxml2-utils python-mako zip time python-pycurl genisoimage patch
sudo apt-get install -y gdisk libyaml-0-2 python-apt python-chardet python-dbus python-dbus-dev python-debian python-gi python-parted python-pkg-resources python-six python-yaml u-boot-tools python-commandnotfound parted
wget -q \
http://repo.linaro.org/ubuntu/linaro-overlay/pool/main/a/android-tools/android-tools-fsutils_4.2.2+git20130218-3ubuntu41+linaro1_amd64.deb \
http://repo.linaro.org/ubuntu/linaro-tools/pool/main/l/linaro-image-tools/linaro-image-tools_2016.02-1.linarojessie.1_amd64.deb \
http://repo.linaro.org/ubuntu/linaro-tools/pool/main/l/linaro-image-tools/python-linaro-image-tools_2016.02-1.linarojessie.1_all.deb
sudo dpkg -i --force-all *.deb
rm -f *.deb
mkdir -p ${HOME}/bin ${WORKSPACE}/build/out
curl https://storage.googleapis.com/git-repo-downloads/repo > ${HOME}/bin/repo
wget https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O ${HOME}/bin/linaro-cp.py
chmod a+x ${HOME}/bin/*
export PATH=${HOME}/bin:${PATH}
if [ ! -d "/home/buildslave/srv/${JOB_NAME}" ]; then
sudo mkdir -p /home/buildslave/srv/${JOB_NAME}
sudo chmod 777 /home/buildslave/srv/${JOB_NAME}
fi
cd /home/buildslave/srv/${JOB_NAME}
git config --global user.email "ci_notify@linaro.org"
git config --global user.name "Linaro CI"
mkdir -p $HOME/.ssh
ssh-keyscan dev-private-git.linaro.org >> $HOME/.ssh/known_hosts
cat << EOF >> $HOME/.ssh/config
Host dev-private-git.linaro.org
User git
EOF
chmod 0600 $HOME/.ssh/*
TMPKEYDIR=$(mktemp -d /tmp/linaroandroid.XXXXXX)
cat > ${TMPKEYDIR}/private-key-wrapper.py << EOF
#!/usr/bin/python
import os
import sys
def main():
private_key = os.environ.get("PRIVATE_KEY", "Undefined")
if private_key == "Undefined":
sys.exit("PRIVATE_KEY is not defined.")
buffer = private_key.replace(' ','\n')
with open('linaro-private-key', 'w') as f:
f.write('-----BEGIN RSA PRIVATE KEY-----\n')
f.write(buffer)
f.write('\n-----END RSA PRIVATE KEY-----\n')
if __name__ == "__main__":
main()
EOF
python ${TMPKEYDIR}/private-key-wrapper.py
chmod 0600 linaro-private-key
eval `ssh-agent` >/dev/null 2>/dev/null
ssh-add linaro-private-key >/dev/null 2>/dev/null
rm -rf linaro-private-key ${TMPKEYDIR}
# Runs as ubuntu
set -xe
rm -rf build-tools jenkins-tools build-configs build/out build/android-patchsets
git clone --depth 1 https://git.linaro.org/people/vishal.bhoj/linaro-android-build-tools-ci.git build-tools
git clone --depth 1 https://git.linaro.org/infrastructure/linaro-jenkins-tools.git jenkins-tools
git clone --depth 1 http://android.git.linaro.org/git/android-build-configs.git build-configs
export BUNDLE_STREAM_NAME=${BUNDLE_STREAM_NAME:-/private/team/wg/wg-private/}
export BUILD_CONFIG_FILENAME=${BUILD_CONFIG_FILENAME:-${JOB_NAME#android-*}}
cat << EOF > config.txt
BUILD_CONFIG_REPO=http://android.git.linaro.org/git/android-build-configs.git
BUILD_CONFIG_BRANCH=master
EOF
echo config.txt
export CONFIG=`base64 -w 0 config.txt`
build-tools/node/build us-east-1.ec2-git-mirror.linaro.org "${CONFIG}"
cp -a /home/buildslave/srv/${JOB_NAME}/build/out/*.xml ${WORKSPACE}/
PUB_SERVER=https://snapshots.linaro.org/
PUB_DEST=/android/$JOB_NAME/$BUILD_NUMBER
time linaro-cp.py \
--api_version 3 \
--manifest \
--no-build-info \
--link-latest \
--split-job-owner \
--server ${PUBLISH_SERVER} \
build/out \
${PUB_DEST} \
--include "^[^/]+[._](img[^/]*|tar[^/]*|xml|sh|config)$" \
--include "^[BHi][^/]+txt$" \
--include "^(MANIFEST|MD5SUMS)$"
# Construct post-build-lava parameters
if [ -f build-configs/${BUILD_CONFIG_FILENAME} ]; then
source build-configs/${BUILD_CONFIG_FILENAME}
else
echo "No config file named ${BUILD_CONFIG_FILENAME} exists"
echo "in android-build-configs.git"
exit 1
fi
cat << EOF > ${WORKSPACE}/post_build_lava_parameters
DEVICE_TYPE=${LAVA_DEVICE_TYPE:-${TARGET_PRODUCT}}
TARGET_PRODUCT=${TARGET_PRODUCT}
MAKE_TARGETS=${MAKE_TARGETS}
JOB_NAME=${JOB_NAME}
BUILD_NUMBER=${BUILD_NUMBER}
BUILD_URL=${BUILD_URL}
LAVA_SERVER=validation.linaro.org/RPC2/
LAVA_STREAM=${BUNDLE_STREAM_NAME}
BUNDLE_STREAM_NAME=${BUNDLE_STREAM_NAME}
FRONTEND_JOB_NAME=${JOB_NAME}
EOF
grep \
-e ^LAVA_JOB_URL \
build-configs/${BUILD_CONFIG_FILENAME} \
| sed -e 's:^LAVA_JOB_URL:CUSTOM_JSON_URL:g' \
>> ${WORKSPACE}/post_build_lava_parameters
echo "Build finished"
- trigger-builds:
- project: 'post-build-lava'
property-file: post_build_lava_parameters
block: true
publishers:
- archive:
artifacts: '*.xml'
latest-only: true
- logparser:
parse-rules: 'Android Build'
unstable-on-warning: false
fail-on-error: false
- fingerprint:
files: 'build/fingerprints/*'
- email:
recipients: 'vishal.bhoj@linaro.org fathi.boudra@linaro.org daniel.diaz@linaro.org'
|