Merge lp:~notnownikki/jenkins-launchpad-plugin/android-multiple-target-fixes into lp:~private-ps-quality-team/jenkins-launchpad-plugin/trunk

Proposed by Nicola Heald
Status: Needs review
Proposed branch: lp:~notnownikki/jenkins-launchpad-plugin/android-multiple-target-fixes
Merge into: lp:~private-ps-quality-team/jenkins-launchpad-plugin/trunk
Diff against target: 218 lines (+199/-0)
4 files modified
build-android.sh (+137/-0)
define-environment (+3/-0)
ubuntu-touch-image-setup.sh (+54/-0)
ubuntu-touch-image.sh (+5/-0)
To merge this branch: bzr merge lp:~notnownikki/jenkins-launchpad-plugin/android-multiple-target-fixes
Reviewer Review Type Date Requested Status
Francis Ginther Needs Fixing
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+207486@code.launchpad.net

This proposal supersedes a proposal from 2014-02-20.

Description of the change

* Only removes old build assets for the device target we're building. (Otherwise, it erased all previous assets when we were building for multiple targets, and we only got one build)

* Change into the correct directory when checking out multiple vendors

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:15
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mike-powerthroughwords/jenkins-launchpad-plugin/android-multiple-target-fixes/+merge/207481/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/jenkins-launchpad-plugin-ci/32/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/jenkins-launchpad-plugin-trusty-amd64-ci/1

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/jenkins-launchpad-plugin-ci/32/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:15
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mike-powerthroughwords/jenkins-launchpad-plugin/android-multiple-target-fixes/+merge/207486/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/jenkins-launchpad-plugin-ci/33/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/jenkins-launchpad-plugin-trusty-amd64-ci/2

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/jenkins-launchpad-plugin-ci/33/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

The target branch for this should be:
lp:~canonical-ci-engineering/jenkins-launchpad-plugin/touch-image-builder

The touch-image-builder isn't a launchpad project.

review: Needs Fixing

Unmerged revisions

15. By Nicola Heald

Make sure we're in the right directory when checking out multiple vendors, only remove assets for old build for the device we're making.

14. By Francis Ginther

Allow for custom vendors and devices and bind mounting of the archive directory (thanks Mike Heald).

13. By Francis Ginther

Making build more verbose and easier to read.

12. By Francis Ginther

Do the setup every time, but remove the package installs.

11. By Francis Ginther

Remove bootstrap of goldfish.

10. By Francis Ginther

Fix TOOL_DIR pull.

9. By Francis Ginther

Add pull or branch logic for TOOLS_DIR.

8. By Francis Ginther

Remove JOB_DIR as this will run from within the jenkins job.

7. By Francis Ginther

Add set -ex to setup script.

6. By Francis Ginther

Add ubuntu-touch-image.sh as a master script.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'build-android.sh'
2--- build-android.sh 1970-01-01 00:00:00 +0000
3+++ build-android.sh 2014-02-20 16:19:43 +0000
4@@ -0,0 +1,137 @@
5+#!/bin/bash
6+# This program is free software: you can redistribute it and/or modify it
7+# under the terms of the the GNU General Public License version 3, as
8+# published by the Free Software Foundation.
9+#
10+# This program is distributed in the hope that it will be useful, but
11+# WITHOUT ANY WARRANTY; without even the implied warranties of
12+# MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
13+# PURPOSE. See the applicable version of the GNU Lesser General Public
14+# License for more details.
15+#.
16+# You should have received a copy of the GNU General Public License
17+# along with this program. If not, see <http://www.gnu.org/licenses/>.
18+#
19+# Copyright (C) 2013 Canonical, Ltd.
20+
21+# The android build gets confused with this set
22+
23+set -xe
24+
25+echo Defining environment
26+
27+. define-environment
28+
29+echo Environment defined
30+
31+export JENKINS_BUILD_NUMBER=$series-$BUILD_NUMBER
32+export stamp=$(pwd)/ubuntu/assets/ubuntu_stamp
33+
34+# if BUILD_NUMBER is set, Android uses it in it's artifact filename
35+unset BUILD_NUMBER
36+#export http_proxy=http://10.128.92.2:3128
37+#export https_proxy=http://10.128.92.2:3128
38+export
39+
40+sum_append() {
41+ cd archive
42+ sha256 $1 > $1.sha256
43+ cd -
44+}
45+
46+repo_dump_heads() {
47+ repo list | awk -F' ' '{print $1}' | while read project; do
48+ gitlog=`git --git-dir=$PWD/$project/.git log -n 1 --pretty="format:%h : %s"`
49+ echo "$project : $gitlog"
50+ done
51+}
52+
53+create_build_stamp() {
54+ echo Creating build stamp
55+ if [ -f $stamp ]
56+ then
57+ rm $stamp
58+ if [ -n "$1" ]
59+ then
60+ echo HARDWARE=$1 >> $stamp
61+ fi
62+ echo JENKINS_BUILD=$JENKINS_BUILD_NUMBER >> $stamp
63+ echo -e "\nAndroid repo head list:" >> $stamp
64+ repo_dump_heads >> $stamp
65+ fi
66+}
67+
68+build_device() {
69+ echo Building $1
70+ create_build_stamp $1
71+ breakfast $1
72+ # The -j1 is only for debugging now
73+ make -j1 showcommands bacon BUILD_WITH_COLORS=0
74+
75+ if [ $? != 0 ]
76+ then
77+ echo Build for $1 failed
78+ exit 1
79+ fi
80+ mv $OUT/cm-10.1-*-$CM_BUILD.zip archive/$series-preinstalled-armel+$CM_BUILD.zip
81+ mv $OUT/recovery.img archive/$series-preinstalled-recovery-armel+$CM_BUILD.img
82+ mv $OUT/system.img archive/$series-preinstalled-system-armel+$CM_BUILD.img
83+ mv $OUT/boot.img archive/$series-preinstalled-boot-armel+$CM_BUILD.img
84+ sum_append $series-preinstalled-armel+$CM_BUILD.zip
85+ sum_append $series-preinstalled-recovery-armel+$CM_BUILD.img
86+ sum_append $series-preinstalled-system-armel+$CM_BUILD.img
87+ sum_append $series-preinstalled-boot-armel+$CM_BUILD.img
88+}
89+
90+if [ -d archive ]
91+then
92+ echo Removing previously archived components for ${CM_BUILD}
93+ rm -rf archive/*${CM_BUILD}*
94+fi
95+
96+echo Creating archive directory
97+mkdir -p archive
98+
99+set -e
100+echo Running repo sync
101+export android_changelog=$(mktemp)
102+repo sync 2>&1 | tee -a $android_changelog
103+repo manifest -o android_manifest.xml -r
104+# Clean empty lines as repo output is not so friendly
105+sed -i '${/^$/d}' $android_changelog
106+set +e
107+
108+. build/envsetup.sh
109+
110+if [ "$clobber" == "true" ]
111+then
112+ echo
113+ echo Cleaning
114+ echo
115+ make clobber
116+else
117+ echo
118+ echo Performing an incremental build
119+ echo
120+fi
121+
122+echo Updating bzr branches
123+for dir in ${BUILD_VENDOR_TARGETS}
124+do
125+ echo Trying to update $dir
126+ if [ -d $dir ]
127+ then
128+ cd vendor/$dir
129+ bzr pull
130+ croot
131+ cd ..
132+ fi
133+done
134+
135+export timestamp=$(date +%Y%m%d)
136+create_build_stamp
137+cp $stamp archive
138+for device in ${BUILD_DEVICE_TARGETS}
139+do
140+ build_device $device
141+done
142
143=== added file 'define-environment'
144--- define-environment 1970-01-01 00:00:00 +0000
145+++ define-environment 2014-02-20 16:19:43 +0000
146@@ -0,0 +1,3 @@
147+export BUILD_DEVICE_TARGETS=${BUILD_DEVICE_TARGETS:-"manta maguro mako grouper"}
148+export BUILD_VENDOR_TARGETS=${BUILD_VENDOR_TARGETS:-"samsung lge audience broadcom nxp nvidia invensense elan widevine asus"}
149+
150
151=== added file 'ubuntu-touch-image-setup.sh'
152--- ubuntu-touch-image-setup.sh 1970-01-01 00:00:00 +0000
153+++ ubuntu-touch-image-setup.sh 2014-02-20 16:19:43 +0000
154@@ -0,0 +1,54 @@
155+#!/bin/bash
156+set -ex
157+
158+. define-environment
159+
160+FLAG_FILE=repo-init-complete
161+
162+#if [ -f $FLAG_FILE ]; then
163+# echo "Skipping repository init"
164+# exit 0
165+#fi
166+
167+TOOLS_DIR=~/phablet-build-scripts
168+# REPO_DIR is equivalent to the jenkins job workspace
169+REPO_DIR=$WORKSPACE
170+
171+# Setup phablet-tools
172+#sudo add-apt-repository ppa:phablet-team/tools
173+#sudo apt-get update
174+#sudo apt-get install -y phablet-tools android-tools-adb android-tools-fastboot
175+
176+# Setup build dependencies
177+#sudo apt-get install -y git gnupg flex bison gperf build-essential \
178+# zip bzr curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
179+# libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
180+# libgl1-mesa-dev g++-multilib mingw32 ubuntu-dev-tools tofrodos \
181+# python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool bsdiff
182+#sudo apt-get install -y openjdk-6-jdk
183+
184+# Setup tools
185+if [ -d $TOOLS_DIR ]; then
186+ cd $TOOLS_DIR
187+ bzr pull
188+ cd -
189+else
190+ bzr branch lp:touch-preview-images/phablet-build-scripts $TOOLS_DIR
191+fi
192+
193+# Init repository
194+phablet-dev-bootstrap . -c
195+for device in ${BUILD_DEVICE_TARGETS}
196+do
197+ phablet-dev-bootstrap -v $device . -c
198+done
199+
200+# Add private branches
201+cd vendor
202+for vendor in ${BUILD_VENDOR_TARGETS}
203+do
204+ bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-${vendor}_jb/ $vendor
205+done
206+cd ..
207+
208+touch $FLAG_FILE
209
210=== added file 'ubuntu-touch-image.sh'
211--- ubuntu-touch-image.sh 1970-01-01 00:00:00 +0000
212+++ ubuntu-touch-image.sh 2014-02-20 16:19:43 +0000
213@@ -0,0 +1,5 @@
214+#!/bin/bash
215+set -ex
216+
217+./ubuntu-touch-image-setup.sh
218+./build-android.sh

Subscribers

People subscribed via source and target branches

to all changes: