chiark / gitweb /
makebuildserver: cache defaults to ~/.cache/fdroidserver
authorHans-Christoph Steiner <hans@eds.org>
Thu, 21 Jan 2016 13:09:12 +0000 (14:09 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 21 Jan 2016 14:34:55 +0000 (15:34 +0100)
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/

examples/makebuildserver.config.py
makebuildserver

index 9795bf765004ef9ffffb7d8d96724752d1a69f41..1d4bd0d3cca3726fe2693468e2c2a20fd9c4a001 100644 (file)
 # or if you have a cached local copy, you can use that first:
 # baseboxurl = ["file:///home/fdroid/fdroidserver/cache/jessie32.box", "https://f-droid.org/jessie32.box"]
 
+# In the process of setting up the build server, many gigs of files
+# are downloaded (Android SDK components, gradle, etc).  These are
+# cached so that they are not redownloaded each time. By default,
+# these are stored in ~/.cache/fdroidserver
+#
+# cachedir = 'buildserver/cache'
+
 # To specify which Debian mirror the build server VM should use, by
 # default it uses http.debian.net, which auto-detects which is the
 # best mirror to use.
index ebd998b2719a2d3539345b6f816cc5190ceec87c..f745b0a3bb9861b5c8711cf353a08fed952ec9b8 100755 (executable)
@@ -50,6 +50,7 @@ config = {
     'arch64': False,
     'basebox': 'jessie32',
     'baseboxurl': 'https://f-droid.org/jessie32.box',
+    'cachedir': os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver'),
     'cpus': 1,
     'memory': 3584,
 }
@@ -72,9 +73,9 @@ if options.clean:
     vagrant(['destroy', '-f'], cwd=serverdir, printout=options.verbose)
 
 # Update cached files.
-cachedir = os.path.join('buildserver', 'cache')
+cachedir = config['cachedir']
 if not os.path.exists(cachedir):
-    os.mkdir(cachedir)
+    os.makedirs(cachedir, 0755)
 
 cachefiles = [
     ('android-sdk_r24.4.1-linux.tgz',