Much better build server provisioning

Including selection of correct ndk architecture, caching and performance
improvements, better configurability, etc.
This commit is contained in:
Ciaran Gultnieks 2013-05-31 07:48:39 +01:00
parent 0985a6d4f4
commit cb16a63409
5 changed files with 124 additions and 53 deletions

View file

@ -1,2 +1,4 @@
.vagrant
up.log
cache/
Vagrantfile

View file

@ -1,26 +0,0 @@
Vagrant::Config.run do |config|
config.vm.box = "raring64"
config.vm.box_url = "/shares/software/OS and Boot/raring64.box"
config.vm.customize ["modifyvm", :id, "--memory", "3584"]
config.vm.provision :shell, :path => "fixpaths.sh"
# Set apt proxy - remove, or adjust this, accordingly!
config.vm.provision :shell, :inline => 'sudo echo "Acquire::http { Proxy \"http://192.168.0.19:8000\"; };" > /etc/apt/apt.conf.d/02proxy && sudo apt-get update'
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.log_level = :debug
chef.json = {
:settings => {
:sdk_loc => "/home/vagrant/android-sdk",
:ndk_loc => "/home/vagrant/android-ndk",
:user => "vagrant"
}
}
chef.add_recipe "fdroidbuild-general"
chef.add_recipe "android-sdk"
chef.add_recipe "android-ndk"
end
end

View file

@ -7,7 +7,12 @@ script "setup-android-ndk" do
user node[:settings][:user]
cwd "/tmp"
code "
tar jxvf /vagrant/cache/android-ndk-r8e-linux-x64.tar.bz2
if [ `uname -m` == 'x86_64' ] ; then
SUFFIX = '_64'
else
SUFFIX = ''
fi
tar jxvf /vagrant/cache/android-ndk-r8e-linux-x86$SUFFIX.tar.bz2
mv android-ndk-r8e #{ndk_loc}
"
not_if do

View file

@ -37,10 +37,16 @@ end
user user
cwd "/tmp"
code "
#{sdk_loc}/tools/android update sdk --no-ui -a -t #{sdk} <<X
if [ -f /vagrant/cache/platforms/#{sdk}.tar.gz ] ; then
echo Installing from cache
tar -C #{sdk_loc}/platforms -z -x -f /vagrant/cache/platforms/#{sdk}.tar.gz
else
echo Installing via 'android'
#{sdk_loc}/tools/android update sdk --no-ui -a -t #{sdk} <<X
y
X
fi
"
not_if "test -d #{sdk_loc}/platforms/#{sdk}"
end
@ -54,10 +60,16 @@ end
user user
cwd "/tmp"
code "
#{sdk_loc}/tools/android update sdk --no-ui -a -t #{sdk} <<X
if [ -f /vagrant/cache/add-ons/#{sdk}.tar.gz ] ; then
echo Installing from cache
tar -C #{sdk_loc}/add-ons -z -x -f /vagrant/cache/add-ons/#{sdk}.tar.gz
else
echo Installing via 'android'
#{sdk_loc}/tools/android update sdk --no-ui -a -t #{sdk} <<X
y
X
fi
"
not_if "test -d #{sdk_loc}/add-ons/#{sdk}"