chiark / gitweb /
buildserver: use pip instead of easy_install for caching
authorHans-Christoph Steiner <hans@eds.org>
Mon, 4 Jul 2016 12:08:54 +0000 (14:08 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Mon, 4 Jul 2016 21:54:52 +0000 (23:54 +0200)
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.

buildserver/cookbooks/fdroidbuild-general/recipes/default.rb [deleted file]
buildserver/provision-pip [new file with mode: 0644]
makebuildserver

diff --git a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
deleted file mode 100644 (file)
index c93722f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-easy_install_package "compare-locales" do
-  options "-U"
-  action :install
-end
diff --git a/buildserver/provision-pip b/buildserver/provision-pip
new file mode 100644 (file)
index 0000000..654bc63
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -e
+set -x
+
+# cache pypi downloads
+if [ -z $PIP_DOWNLOAD_CACHE ]; then
+    export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache
+fi
+
+apt-get install --yes --no-install-recommends python-pip
+
+pip install --upgrade $@
index 0b1da7331a6f962f4625fdc6ba3a70b477f0c26c..0a0e0d4346f09d996155498785be8b4d37588707 100755 (executable)
@@ -383,13 +383,14 @@ vagrantfile += """
   config.vm.provision :chef_solo do |chef|
     chef.cookbooks_path = "cookbooks"
     chef.log_level = :debug
-    chef.add_recipe "fdroidbuild-general"
     chef.add_recipe "kivy"
   end
 
   config.vm.provision "shell", path: "provision-android-sdk"
   config.vm.provision "shell", path: "provision-android-ndk",
     args: ["/home/vagrant/android-ndk"]
+  config.vm.provision "shell", path: "provision-pip",
+    args: ["compare-locales"]
   config.vm.provision "shell", path: "provision-gradle"
   config.vm.provision "file", source: "gradle",
     destination: "/opt/gradle/bin/gradle"