Merge lp:~sergiusens/jenkins-launchpad-plugin/touch-image-builder into lp:~private-ps-quality-team/jenkins-launchpad-plugin/trunk

Proposed by Sergio Schvezov
Status: Superseded
Proposed branch: lp:~sergiusens/jenkins-launchpad-plugin/touch-image-builder
Merge into: lp:~private-ps-quality-team/jenkins-launchpad-plugin/trunk
Diff against target: 203 lines (+189/-0)
3 files modified
build-android.sh (+130/-0)
ubuntu-touch-image-setup.sh (+54/-0)
ubuntu-touch-image.sh (+5/-0)
To merge this branch: bzr merge lp:~sergiusens/jenkins-launchpad-plugin/touch-image-builder

This proposal has been superseded by a proposal from 2014-01-07.

To post a comment you must log in.
12. By Sergio Schvezov

Making build more verbose and easier to read

Unmerged revisions

12. By Sergio Schvezov

Making build more verbose and easier to read

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.

5. By Francis Ginther

Make ubuntu-touch-image-setup.sh executable.

4. By Francis Ginther

Adding Android build script.

3. By Francis Ginther

Update vendor branches.

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-01-07 19:02:29 +0000
4@@ -0,0 +1,130 @@
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+export JENKINS_BUILD_NUMBER=$series-$BUILD_NUMBER
26+export stamp=$(pwd)/ubuntu/assets/ubuntu_stamp
27+
28+# if BUILD_NUMBER is set, Android uses it in it's artifact filename
29+unset BUILD_NUMBER
30+#export http_proxy=http://10.128.92.2:3128
31+#export https_proxy=http://10.128.92.2:3128
32+export
33+
34+sum_append() {
35+ cd archive
36+ sha256 $1 > $1.sha256
37+ cd -
38+}
39+
40+repo_dump_heads() {
41+ repo list | awk -F' ' '{print $1}' | while read project; do
42+ gitlog=`git --git-dir=$PWD/$project/.git log -n 1 --pretty="format:%h : %s"`
43+ echo "$project : $gitlog"
44+ done
45+}
46+
47+create_build_stamp() {
48+ echo Creating build stamp
49+ if [ -f $stamp ]
50+ then
51+ rm $stamp
52+ if [ -n "$1" ]
53+ then
54+ echo HARDWARE=$1 >> $stamp
55+ fi
56+ echo JENKINS_BUILD=$JENKINS_BUILD_NUMBER >> $stamp
57+ echo -e "\nAndroid repo head list:" >> $stamp
58+ repo_dump_heads >> $stamp
59+ fi
60+}
61+
62+build_device() {
63+ echo Building $1
64+ create_build_stamp $1
65+ breakfast $1
66+ # The -j1 is only for debugging now
67+ make -j1 showcommands bacon BUILD_WITH_COLORS=0
68+ if [ $? != 0 ]
69+ then
70+ echo Build for $1 failed
71+ exit 1
72+ fi
73+ mv $OUT/cm-10.1-*-$CM_BUILD.zip archive/$series-preinstalled-armel+$CM_BUILD.zip
74+ mv $OUT/recovery.img archive/$series-preinstalled-recovery-armel+$CM_BUILD.img
75+ mv $OUT/system.img archive/$series-preinstalled-system-armel+$CM_BUILD.img
76+ mv $OUT/boot.img archive/$series-preinstalled-boot-armel+$CM_BUILD.img
77+ sum_append $series-preinstalled-armel+$CM_BUILD.zip
78+ sum_append $series-preinstalled-recovery-armel+$CM_BUILD.img
79+ sum_append $series-preinstalled-system-armel+$CM_BUILD.img
80+ sum_append $series-preinstalled-boot-armel+$CM_BUILD.img
81+}
82+
83+if [ -d archive ]
84+then
85+ echo Removing previously archived components
86+ rm -rf archive
87+fi
88+
89+echo Creating archive directory
90+mkdir archive
91+
92+set -e
93+echo Running repo sync
94+export android_changelog=$(mktemp)
95+repo sync 2>&1 | tee -a $android_changelog
96+repo manifest -o android_manifest.xml -r
97+# Clean empty lines as repo output is not so friendly
98+sed -i '${/^$/d}' $android_changelog
99+set +e
100+
101+. build/envsetup.sh
102+
103+if [ "$clobber" == "true" ]
104+then
105+ echo
106+ echo Cleaning
107+ echo
108+ make clobber
109+else
110+ echo
111+ echo Performing an incremental build
112+ echo
113+fi
114+
115+echo Updating bzr branches
116+for dir in vendor/samsung vendor/lge vendor/audience vendor/broadcom vendor/nxp vendor/nvidia vendor/invensense vendor/elan vendor/widevine vendor/asus
117+do
118+ echo Trying to update $dir
119+ if [ -d $dir ]
120+ then
121+ cd $dir
122+ bzr pull
123+ croot
124+ fi
125+done
126+
127+export timestamp=$(date +%Y%m%d)
128+create_build_stamp
129+cp $stamp archive
130+build_device manta
131+build_device maguro
132+build_device mako
133+build_device grouper
134+
135
136=== added file 'ubuntu-touch-image-setup.sh'
137--- ubuntu-touch-image-setup.sh 1970-01-01 00:00:00 +0000
138+++ ubuntu-touch-image-setup.sh 2014-01-07 19:02:29 +0000
139@@ -0,0 +1,54 @@
140+#!/bin/bash
141+set -ex
142+
143+FLAG_FILE=repo-init-complete
144+
145+if [ -f $FLAG_FILE ]; then
146+ echo "Skipping repository init"
147+ exit 0
148+fi
149+
150+TOOLS_DIR=~/phablet-build-scripts
151+# REPO_DIR is equivalent to the jenkins job workspace
152+REPO_DIR=/home/ubuntu/jenkins/workspace/ubuntu-touch-image
153+
154+# Setup phablet-tools
155+sudo add-apt-repository ppa:phablet-team/tools
156+sudo apt-get update
157+sudo apt-get install -y phablet-tools android-tools-adb android-tools-fastboot
158+
159+# Setup build dependencies
160+sudo apt-get install -y git gnupg flex bison gperf build-essential \
161+ zip bzr curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
162+ libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
163+ libgl1-mesa-dev g++-multilib mingw32 ubuntu-dev-tools tofrodos \
164+ python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool bsdiff
165+sudo apt-get install -y openjdk-6-jdk
166+
167+# Setup tools
168+if [ -d $TOOLS_DIR ]; then
169+ cd $TOOLS_DIR
170+ bzr pull
171+ cd -
172+else
173+ bzr branch lp:touch-preview-images/phablet-build-scripts $TOOLS_DIR
174+fi
175+
176+# Init repository
177+phablet-dev-bootstrap . -c
178+phablet-dev-bootstrap -v mako,maguro,manta,grouper . -c
179+
180+# Add private branches
181+cd vendor
182+bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-asus_jb/ asus
183+bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-audience_jb/ audience
184+bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-broadcom_jb/ broadcom
185+bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-elan_jb/ elan
186+bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-lge_jb/ lge
187+bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-nvidia_jb/ nvidia
188+bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-nxp_jb/ nxp
189+bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-samsung_jb/ samsung
190+bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-widevine_jb/ widevine
191+cd ..
192+
193+touch $FLAG_FILE
194
195=== added file 'ubuntu-touch-image.sh'
196--- ubuntu-touch-image.sh 1970-01-01 00:00:00 +0000
197+++ ubuntu-touch-image.sh 2014-01-07 19:02:29 +0000
198@@ -0,0 +1,5 @@
199+#!/bin/bash
200+set -ex
201+
202+./ubuntu-touch-image-setup.sh
203+./build-android.sh

Subscribers

People subscribed via source and target branches

to all changes: