1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-14 13:00:08 +02:00
Commit Graph

98 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
2e1ec71404 buildserver: send config to vagrant via YAML file
Python can easily output dicts as YAML, and a Vagrantfile is a ruby script,
which can easily read YAML.  Going this route means that Vagrantfile can
ultimately be committed to git, and the configuration will happen all via
Python dicts output as YAML.  That makes it drastically easier to follow
the code, and to make modifications.
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
0171dd60fd buildserver: use pip instead of easy_install for caching
easy_install does not provide any download caching, while pip does. This
also moves the python module installing a shell script that takes python
packages as args.  That will allow for future uses like allowing app
metadata to include pip modules that they need.
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
aafad6b909 buildserver: move apt setup to a shell script
This makes it so there is only a single `apt-get install` command run,
instead of one command per-package like with the chef script.  It also adds
`apt-get upgrade` to make sure that the base box is fully up-to-date.
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
2374b12a77 buildserver: move trusty/paramiko hack to its own shell script
This is part of the effort to remove moving parts from the whole build
server setup.  Why wrap shell scripts in ruby and chef if we can just
directly run a shell script?
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
2227cc6d1a buildserver: download and cache latest platform-tools and m2repository
Also, by having our own checksums for all the bits means that we can safely
add support for local mirrors, like a bunch in China, for example:
http://mirrors.neusoft.edu.cn/android/repository/
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
2daf00abb7 buildserver: remove last vestige of 32-bit buildserver 2016-07-04 23:52:52 +02:00
Daniel Martí
a573688a44 makebs: flip arch64 bool
The last commit was missing this.
2016-07-04 12:01:58 +01:00
Hans-Christoph Steiner
bfd80d12d9 switch to new 64-bit base box image: https://f-droid.org/jessie64.box
build-tools and other SDK bits from android-24 require 64-bit GNU/Linux
2016-07-04 12:34:00 +02:00
Daniel Martí
be4953be02 Add Gradle 2.2 and 2.14 to the buildserver
2.2 can be specifically requested by an app, and in some extreme cases
those apps don't build with 2.2.1.
2016-06-24 17:06:17 +01:00
Daniel Martí
06003d3c04 Add platform-24 to the buildserver 2016-06-24 17:06:17 +01:00
Daniel Martí
b026874353 all: add and switch to build-tools v24 2016-06-24 17:06:16 +01:00
Hans-Christoph Steiner
226237c5f7 buildserver: do not set NDK env vars, they are handled by fdroid build
`fdroid build` handles setting the NDK env vars since the NDK version can
change depending on the app being build.  Unlike ANDROID_HOME, there is no
single global NDK location.  The NDK installs are all versioned.
2016-06-21 10:29:56 +02:00
Ciaran Gultnieks
9a2e06fd5c Tone down makebuildserver terminal spamming
The progress bar updating at each 1k chunk spams the terminal to such an
extent it stops responding to keypresses (at least with a fast
connection). It also seems extremely inefficient to be writing the file
in 1k chunks. This makes it 64k, which is more reasonable but quite
probably still too small.
2016-06-17 13:39:01 +01:00
Hans-Christoph Steiner
d0bb6f73bf buildserver: /vagrant/cache writeable only by root
Prevent build processes from modifying the cache, it is only needed
during provisioning anyway. A malicious build could still use sudo to
change the cache, but this is more to prevent mistaken modifications.
2016-06-15 16:35:00 +02:00
Hans-Christoph Steiner
6ea2508127 buildserver: unpack gradle versions with provisioning shell script
This was not using anything special from chef, so do it in a shell script
instead.  This makes the script easier for the python/shell people, and
probably uses less memory, since chef is a memory hog.  This might even
make the provision go faster since it uploads the whole script as a file to
the VM, then runs it there.  I think chef sends each command via SSH.
2016-06-15 16:35:00 +02:00
Hans-Christoph Steiner
02a835ff95 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.
2016-06-15 16:35:00 +02:00
Hans-Christoph Steiner
e47396b403 buildserver: use android update sdk to install Android SDK
`android update sdk --no-ui` is the standard command line tool for
installing the Android SDK.  By symlinking into the $ANDROID_HOME/temp dir,
the cached files can still be used.  This converts the chef recipe to a
vagrant shell provisioning script since it was all bash anyway.

Some file names no longer officially have a -linux in them, so those were
changed to keep the cache working with the default filename.
2016-06-15 15:26:35 +02:00
Hans-Christoph Steiner
e449d2f583 buildserver: setup env vars using standard script
bash provides a standard file location for a script to be run when the
shell starts: /etc/profile.d/  This converts the scattered bits of code for
making ~/.bsenv into a single provisioning script to generate
/etc/profile.d/bsenv.sh, which gets automatically executed when bash starts
2016-06-15 15:26:35 +02:00
Hans-Christoph Steiner
714b3b9ff6 makebuildserver: use original names for downloaded SDK components
It will make it a lot easier to manage the cache if we use the original
file names, which often include the file version.  This also changes the
download process to be resumable if there is a partial file in the cache,
and switches from calling wget on the command line to using the python libs
'requests' and 'clint' to provide a similar experience.  While its not so
important for this particular bit of code to use those libraries, I think
those two will allow us to provide a better user experience throughout the
whole of fdroidserver.

In this case, it is already doing special tricks fetching the file size
from the server before trying to download it.  I suppose this code could
instead check if the file exists, and if so, check the hash sum.  I think
that would be slower for most people since checking the hash on large files
takes a noticeable about of time, while a HTTP HEAD request is pretty tiny.
2016-06-14 14:21:59 +02:00
Daniel Martí
ec7beb8388 Bump platform-23 to r03 2016-05-27 14:08:57 +01:00
Daniel Martí
d5d22dbc99 Update android sdk version
Install version 25 now. Also use the smaller tools zip. While at it,
also remove the tools re-install - it's not worth it, as long as we keep
the initial tools zip up to date.
2016-05-27 14:08:57 +01:00
Daniel Martí
1edd9cde3c Add gradle 2.13 2016-05-27 14:08:57 +01:00
Ciaran Gultnieks
4eb5fa88be Fix gradle download url for 2.12 2016-04-07 08:30:10 +01:00
Daniel Martí
ec9087d057 Add and switch to build-tools 23.0.3
Also bump to the CI image which contains it.
2016-04-05 10:49:30 +01:00
Daniel Martí
a345e351ba Add Gradle 2.12 to the buildserver 2016-04-05 10:49:15 +01:00
Ciaran Gultnieks
009a926ea4 Remove extra blank lines in makebuildserver output
These seem to have appeared during the py3 conversion.
2016-03-21 08:45:42 +00:00
Hans-Christoph Steiner
8f99400064 makebuildserver: buildserverid should always be a string 2016-03-14 17:35:44 +01:00
Hans-Christoph Steiner
7039d16046 always parse versions as strings, not bytes
Fixes a couple errors like:
  File "./makebuildserver", line 30, in vagrant
    out += line
  TypeError: Can't convert 'bytes' object to str implicitly

If universal_newlines=False, the default, then Popen will return bytes if
the newlines in the data do not match the system's newlines.  Setting it to
true enables auto-conversion, and then guarantees that the data is always
str.

"If universal_newlines is True, the file objects stdin, stdout and stderr
are opened as text streams in universal newlines mode, as described above
in Frequently Used Arguments, otherwise they are opened as binary streams."
https://docs.python.org/3/library/subprocess.html#subprocess.Popen
2016-03-14 12:49:38 +01:00
Ciaran Gultnieks
bc131856d2 Fix python2/makebuildserver breakage 2016-03-13 20:49:38 +00:00
Daniel Martí
fc0746712d Merge branch 'master' into 'master'
makebuildserver: support running VirtualBox in a VM

For debian.jenkins.net, our test environment is a kvm instance that does not expose the hardware virtualization instructions.  So this auto-detects whether the current machine, virtual or not, supports the hardware virtualization.  If not, it uses VirtualBox's software emulator, which should run everywhere, even in a kvm instance.

See merge request !108
2016-03-11 23:53:25 +00:00
Daniel Martí
49ac25270e Run 2to3 on makebuildserver
Mostly just print conversion.
2016-03-10 16:43:37 +00:00
Daniel Martí
99edd64372 Switch all headers to python3 2016-03-10 16:43:36 +00:00
Hans-Christoph Steiner
6f254ff7b6 makebuildserver: use VB software virt if hardware is not available
This checks the local CPU settings to see if it has the right virtualizing
CPU instructions, and only uses VirtualBox hardware virtualization on
setups where it is available.  VMs instances usually do not provide these
instructions.  Where the CPU features are not available, it will use VB's
software virtualization.
2016-03-10 12:28:31 +01:00
Daniel Martí
da0a787879 Add gradle 2.11 2016-02-15 12:02:45 +00:00
Hans-Christoph Steiner
7f451a815b makebuildserver: add workaround to Ubuntu/trusty's old paramiko
Ubuntu trusty 14.04's paramiko does not work with jessie's openssh's
default settings, so they need to be tweaked in order to provide working
ssh to the instance.

https://stackoverflow.com/questions/7286929/paramiko-incompatible-ssh-peer-no-acceptable-kex-algorithm/32691055#32691055
2016-02-11 20:27:30 +01:00
Hans-Christoph Steiner
09daa5eee0 makebuildserver: default memory to 1024MB, so it runs on normal machines
4 gigs is still a common amount of RAM these days for laptops, if the VM
takes almost all of that, it makes the machine drag to almost a halt. Most
apps build fine in 1gig of RAM, indeed that's the default for most CI
instances, like travis-ci and gitlab-ci.
2016-02-03 14:54:14 +01:00
Hans-Christoph Steiner
dd93505fce allow setting up an apt package cache for the build server setup
This creates a cache folder which will store the apt cache from the VM.
2016-02-03 14:54:14 +01:00
Hans-Christoph Steiner
b6a5978b11 makebuildserver: make chef find the custom cache locations 2016-02-03 14:54:14 +01:00
Hans-Christoph Steiner
90d81eba2d makebuildserver: settable vm boot timeout, plus longer default
On slow machines or VMs like the Debian jenkins box, the VM boot timeout
needs to be a lot longer, otherwise vagrant times out before setting up
the VM.
2016-01-26 17:47:17 +01:00
Hans-Christoph Steiner
3511c44357 makebuildserver: explicitly set debian_mirror by default
There needs to be a default, otherwise it crashes.  I should have included
this in 8d66742dd7
2016-01-26 17:46:51 +01:00
Hans-Christoph Steiner
8d66742dd7 makebuildserver: set debian mirror in config file only
Setting it in the config file was not working, and right now, all of the
options are in the config file and not as command line flags, so remove
--debian-mirror to keep that consistent.
2016-01-26 11:31:40 +01:00
Hans-Christoph Steiner
82e26cf59e makebuildserver: use jessie32.box from cache, if present 2016-01-26 11:31:40 +01:00
Hans-Christoph Steiner
24a9f3b816 makebuildserver: delete cached files with zero size
If download fails to connect, it'll make a zero size file.  Then the next
run on ./makebuildserver will fail because the checksum will not be right.
2016-01-21 15:41:26 +01:00
Hans-Christoph Steiner
cda8fa00f5 makebuildserver: cache defaults to ~/.cache/fdroidserver
This also provides a config option to override that default.  ~/.cache is
a standard location on GNU/Linux machines for cached content.  It is also
good to have the cache outside of the git repo in case `git clean -fdx` is
run, which would delete all files in the directory that are not part of the
git repo, including buildserver/cache/
2016-01-21 15:34:55 +01:00
Hans-Christoph Steiner
3bd8ef2c8c makebuildserver: set defaults in script so it can run without config
This makes it so that ./makebuildserver will run without any config file,
using the defaults that are embedded in the script itself.  This is like
how `fdroid` works.
2016-01-21 15:34:55 +01:00
Hans-Christoph Steiner
50713c7ce9 makebuildserver: set default Debian mirror to http.debian.net
This host automatically detects which is the closest mirror, then uses that
one.  It does so dynamically, so it'll work on machines that move too. Now
that we are pushing more people to run F-Droid build servers, the defaults
should take those use cases into account.
2016-01-21 15:34:55 +01:00
Hans-Christoph Steiner
b33add9ce7 name makebuildserver config the same as the script
This keeps the numbers of names down to a minimum, and since the config
is placed right next to the script, this keeps tab completion working
nicely when the config file is in place.

The old file name is still supported.
2016-01-21 15:34:55 +01:00
Daniel Martí
bd29fce13b Add Gradle 2.10 to the BS 2016-01-05 09:15:54 +01:00
Daniel Martí
73c680dfcf Add gradle 2.9 to the BS 2015-11-20 14:08:54 -08:00
Daniel Martí
882cfe3912 Install build-tools from the cache too 2015-11-20 14:08:54 -08:00