Merge lp:~notnownikki/jenkins-launchpad-plugin/touch-image-builder into lp:~canonical-ci-engineering/jenkins-launchpad-plugin/touch-image-builder

Proposed by Nicola Heald
Status: Merged
Approved by: Francis Ginther
Approved revision: 15
Merged at revision: 14
Proposed branch: lp:~notnownikki/jenkins-launchpad-plugin/touch-image-builder
Merge into: lp:~canonical-ci-engineering/jenkins-launchpad-plugin/touch-image-builder
Diff against target: 103 lines (+23/-19)
3 files modified
build-android.sh (+10/-9)
define-environment (+3/-0)
ubuntu-touch-image-setup.sh (+10/-10)
To merge this branch: bzr merge lp:~notnownikki/jenkins-launchpad-plugin/touch-image-builder
Reviewer Review Type Date Requested Status
Francis Ginther Approve
Review via email: mp+206431@code.launchpad.net

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

Description of the change

* Removes contents of archive instead of the archive directory. This is so that directory can be bind mounted in another location outside of the build chroot.

* Moves the hardcoded list of vendors and devices to build into two variables at the start of the script. These can be overridden so that you can build for only one vendor/device.

To post a comment you must log in.
Revision history for this message
Francis Ginther (fginther) wrote : Posted in a previous version of this proposal

Please add some variable initialization to ubuntu-touch-image-setup.sh, (or better yet, source a common file with the variable init done only once) this could be executed prior to build-android.sh and would fail if the environment wasn't already setup.

BUILD_DEVICE_TARGETS=${BUILD_DEVICE_TARGETS:-"manta maguro mako grouper"}
BUILD_VENDOR_TARGETS=${BUILD_VENDOR_TARGETS:-"samsung lge audience broadcom nxp nvidia invensense elan widevine asus"}

review: Needs Fixing
Revision history for this message
Nicola Heald (notnownikki) wrote : Posted in a previous version of this proposal

Do you mean, move those variable init lines to ubuntu-touch-image-setup.sh
and have build-android.sh fail if they're not set, or check for them
in ubuntu-touch-image-setup.sh and have ubuntu-touch-image-setup.sh fail if
they're not set?

On Thu, Feb 13, 2014 at 4:11 PM, Francis Ginther <
<email address hidden>> wrote:

> Review: Needs Fixing
>
> Please add some variable initialization to ubuntu-touch-image-setup.sh,
> (or better yet, source a common file with the variable init done only once)
> this could be executed prior to build-android.sh and would fail if the
> environment wasn't already setup.
>
> BUILD_DEVICE_TARGETS=${BUILD_DEVICE_TARGETS:-"manta maguro mako grouper"}
> BUILD_VENDOR_TARGETS=${BUILD_VENDOR_TARGETS:-"samsung lge audience
> broadcom nxp nvidia invensense elan widevine asus"}
> --
>
> https://code.launchpad.net/~mike-powerthroughwords/jenkins-launchpad-plugin/touch-image-builder/+merge/206204
> You are the owner of
> lp:~mike-powerthroughwords/jenkins-launchpad-plugin/touch-image-builder.
>

Revision history for this message
Francis Ginther (fginther) wrote : Posted in a previous version of this proposal

Sorry, I should have been more clear. As two script use these two variables, can they be moved to an independent location (i.e. a file called define-environment) and then both scripts could just import the same definition with:

. define-environment

Revision history for this message
Nicola Heald (notnownikki) wrote : Posted in a previous version of this proposal

Gotcha, and both scripts should complain if they're not set.

At the moment, the scripts build all vendors, all devices. Should that be
kept as the default behaviour id they're not overridden in the environment?

On Thu, Feb 13, 2014 at 8:48 PM, Francis Ginther <
<email address hidden>> wrote:

> Sorry, I should have been more clear. As two script use these two
> variables, can they be moved to an independent location (i.e. a file called
> define-environment) and then both scripts could just import the same
> definition with:
>
> . define-environment
> --
>
> https://code.launchpad.net/~mike-powerthroughwords/jenkins-launchpad-plugin/touch-image-builder/+merge/206204
> You are the owner of
> lp:~mike-powerthroughwords/jenkins-launchpad-plugin/touch-image-builder.
>

Revision history for this message
Francis Ginther (fginther) wrote :

Looks good, thanks for making the change.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build-android.sh'
2--- build-android.sh 2014-01-07 19:05:06 +0000
3+++ build-android.sh 2014-02-14 11:32:26 +0000
4@@ -18,6 +18,8 @@
5
6 set -xe
7
8+. define-environment
9+
10 export JENKINS_BUILD_NUMBER=$series-$BUILD_NUMBER
11 export stamp=$(pwd)/ubuntu/assets/ubuntu_stamp
12
13@@ -80,11 +82,11 @@
14 if [ -d archive ]
15 then
16 echo Removing previously archived components
17- rm -rf archive
18+ rm -rf archive/*
19 fi
20
21 echo Creating archive directory
22-mkdir archive
23+mkdir -p archive
24
25 set -e
26 echo Running repo sync
27@@ -110,12 +112,12 @@
28 fi
29
30 echo Updating bzr branches
31-for dir in vendor/samsung vendor/lge vendor/audience vendor/broadcom vendor/nxp vendor/nvidia vendor/invensense vendor/elan vendor/widevine vendor/asus
32+for dir in ${BUILD_VENDOR_TARGETS}
33 do
34 echo Trying to update $dir
35 if [ -d $dir ]
36 then
37- cd $dir
38+ cd vendor/$dir
39 bzr pull
40 croot
41 fi
42@@ -124,8 +126,7 @@
43 export timestamp=$(date +%Y%m%d)
44 create_build_stamp
45 cp $stamp archive
46-build_device manta
47-build_device maguro
48-build_device mako
49-build_device grouper
50-
51+for device in ${BUILD_DEVICE_TARGETS}
52+do
53+ build_device $device
54+done
55
56=== added file 'define-environment'
57--- define-environment 1970-01-01 00:00:00 +0000
58+++ define-environment 2014-02-14 11:32:26 +0000
59@@ -0,0 +1,3 @@
60+export BUILD_DEVICE_TARGETS=${BUILD_DEVICE_TARGETS:-"manta maguro mako grouper"}
61+export BUILD_VENDOR_TARGETS=${BUILD_VENDOR_TARGETS:-"samsung lge audience broadcom nxp nvidia invensense elan widevine asus"}
62+
63
64=== modified file 'ubuntu-touch-image-setup.sh'
65--- ubuntu-touch-image-setup.sh 2014-01-07 14:11:10 +0000
66+++ ubuntu-touch-image-setup.sh 2014-02-14 11:32:26 +0000
67@@ -1,6 +1,8 @@
68 #!/bin/bash
69 set -ex
70
71+. define-environment
72+
73 FLAG_FILE=repo-init-complete
74
75 #if [ -f $FLAG_FILE ]; then
76@@ -36,19 +38,17 @@
77
78 # Init repository
79 phablet-dev-bootstrap . -c
80-phablet-dev-bootstrap -v mako,maguro,manta,grouper . -c
81+for device in ${BUILD_DEVICE_TARGETS}
82+do
83+ phablet-dev-bootstrap -v $device . -c
84+done
85
86 # Add private branches
87 cd vendor
88-bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-asus_jb/ asus
89-bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-audience_jb/ audience
90-bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-broadcom_jb/ broadcom
91-bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-elan_jb/ elan
92-bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-lge_jb/ lge
93-bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-nvidia_jb/ nvidia
94-bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-nxp_jb/ nxp
95-bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-samsung_jb/ samsung
96-bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-widevine_jb/ widevine
97+for vendor in ${BUILD_VENDOR_TARGETS}
98+do
99+ bzr branch bzr+ssh://bazaar.launchpad.net/~rocket-scientists/aal+/cm-vendor-${vendor}_jb/ $vendor
100+done
101 cd ..
102
103 touch $FLAG_FILE

Subscribers

People subscribed via source and target branches