mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-14 11:00:10 +01:00
buildserver: unpack NDK with a provisioning shell script
This makes the process closer to ./jenkins-build scripts and .gitlab-ci.yml files. Hopefully it uses less RAM than chef too.
This commit is contained in:
parent
e47396b403
commit
02a835ff95
@ -1,50 +0,0 @@
|
|||||||
|
|
||||||
ndk_loc = node[:settings][:ndk_loc]
|
|
||||||
user = node[:settings][:user]
|
|
||||||
|
|
||||||
script "setup-android-ndk" do
|
|
||||||
timeout 14400
|
|
||||||
interpreter "bash"
|
|
||||||
user node[:settings][:user]
|
|
||||||
cwd "/tmp"
|
|
||||||
code "
|
|
||||||
mkdir -p #{ndk_loc}
|
|
||||||
"
|
|
||||||
end
|
|
||||||
|
|
||||||
script "setup-android-ndk-r9b" do
|
|
||||||
timeout 14400
|
|
||||||
interpreter "bash"
|
|
||||||
user node[:settings][:user]
|
|
||||||
cwd "/tmp"
|
|
||||||
code "
|
|
||||||
if [ `uname -m` == 'x86_64' ] ; then
|
|
||||||
SUFFIX='_64'
|
|
||||||
else
|
|
||||||
SUFFIX=''
|
|
||||||
fi
|
|
||||||
tar jxvf /vagrant/cache/android-ndk-r9b-linux-x86$SUFFIX.tar.bz2
|
|
||||||
tar jxvf /vagrant/cache/android-ndk-r9b-linux-x86$SUFFIX-legacy-toolchains.tar.bz2
|
|
||||||
mv android-ndk-r9b #{ndk_loc}/r9b
|
|
||||||
"
|
|
||||||
not_if "test -d #{ndk_loc}/r9b"
|
|
||||||
end
|
|
||||||
|
|
||||||
script "setup-android-ndk-r10e" do
|
|
||||||
timeout 14400
|
|
||||||
interpreter "bash"
|
|
||||||
user node[:settings][:user]
|
|
||||||
cwd "/tmp"
|
|
||||||
code "
|
|
||||||
if [ `uname -m` == 'x86_64' ] ; then
|
|
||||||
SUFFIX='_64'
|
|
||||||
else
|
|
||||||
SUFFIX=''
|
|
||||||
fi
|
|
||||||
cd #{ndk_loc}
|
|
||||||
7zr x /vagrant/cache/android-ndk-r10e-linux-x86$SUFFIX.bin
|
|
||||||
mv android-ndk-r10e r10e
|
|
||||||
"
|
|
||||||
not_if "test -d #{ndk_loc}/r10e"
|
|
||||||
end
|
|
||||||
|
|
36
buildserver/provision-android-ndk
Normal file
36
buildserver/provision-android-ndk
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z $ANDROID_NDK_HOME ]; then
|
||||||
|
echo "ANDROID_NDK_HOME env var must be set!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
test -e $ANDROID_NDK_HOME || mkdir -p $ANDROID_NDK_HOME
|
||||||
|
cd $ANDROID_NDK_HOME
|
||||||
|
|
||||||
|
if [ ! -e $ANDROID_NDK_HOME/r9b ]; then
|
||||||
|
if [ `uname -m` == 'x86_64' ] ; then
|
||||||
|
SUFFIX='_64'
|
||||||
|
else
|
||||||
|
SUFFIX=''
|
||||||
|
fi
|
||||||
|
tar jxvf /vagrant/cache/android-ndk-r9b-linux-x86$SUFFIX.tar.bz2
|
||||||
|
tar jxvf /vagrant/cache/android-ndk-r9b-linux-x86$SUFFIX-legacy-toolchains.tar.bz2
|
||||||
|
mv android-ndk-r9b r9b
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e $ANDROID_NDK_HOME/r10e ]; then
|
||||||
|
if [ `uname -m` == 'x86_64' ] ; then
|
||||||
|
SUFFIX='_64'
|
||||||
|
else
|
||||||
|
SUFFIX=''
|
||||||
|
fi
|
||||||
|
7zr x /vagrant/cache/android-ndk-r10e-linux-x86$SUFFIX.bin > /dev/null
|
||||||
|
mv android-ndk-r10e r10e
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod -R a+rX $ANDROID_NDK_HOME/
|
||||||
|
find $ANDROID_NDK_HOME/ -type f -executable -print0 | xargs -0 chmod a+x
|
@ -386,19 +386,18 @@ vagrantfile += """
|
|||||||
chef.log_level = :debug
|
chef.log_level = :debug
|
||||||
chef.json = {
|
chef.json = {
|
||||||
:settings => {
|
:settings => {
|
||||||
:ndk_loc => "/home/vagrant/android-ndk",
|
|
||||||
:debian_mirror => "%s",
|
:debian_mirror => "%s",
|
||||||
:ubuntu_trusty => "%s",
|
:ubuntu_trusty => "%s",
|
||||||
:user => "vagrant"
|
:user => "vagrant"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chef.add_recipe "fdroidbuild-general"
|
chef.add_recipe "fdroidbuild-general"
|
||||||
chef.add_recipe "android-ndk"
|
|
||||||
chef.add_recipe "gradle"
|
chef.add_recipe "gradle"
|
||||||
chef.add_recipe "kivy"
|
chef.add_recipe "kivy"
|
||||||
end
|
end
|
||||||
|
|
||||||
config.vm.provision "shell", path: "provision-android-sdk"
|
config.vm.provision "shell", path: "provision-android-sdk"
|
||||||
|
config.vm.provision "shell", path: "provision-android-ndk"
|
||||||
|
|
||||||
end
|
end
|
||||||
""" % (config['debian_mirror'],
|
""" % (config['debian_mirror'],
|
||||||
|
Loading…
Reference in New Issue
Block a user