aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSam Pearson <sam@sgp.me.uk>2020-02-12 16:39:18 +0000
committerSam Pearson <sam@sgp.me.uk>2020-03-03 09:20:46 +0000
commit2baa60e1d41c88a69246732fbbef36167d367ea5 (patch)
tree9b1874e833c830017ecd3fd95293efebf9b536a1 /bin
parentd65ce0e6b24c8302db4107290d12d8e7d5c864b9 (diff)
[script/bootstrap] Keep OS packages updated in development environments
This adds a script, `bin/install_packages`, that will install packages listed in versions of `conf/packages*` and calls it from the bootstrap script in a way appropriate to the environment it is being run under. This should ensure that, for example, changes to dependencies will be applied to Vagrant machines in-between tagged releases. The default packages file used will be `packages.generic`.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/install_packages13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/install_packages b/bin/install_packages
new file mode 100755
index 000000000..7b4bfd8e1
--- /dev/null
+++ b/bin/install_packages
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -e
+
+cd "$(dirname "${BASH_SOURCE[0]}")/.."
+
+PACKAGE_FILE=conf/packages
+
+[ -n "$1" ] && PACKAGE_FILE="conf/packages.${1}"
+
+apt-get update
+
+grep -v ^# $PACKAGE_FILE | grep -v ^$ | xargs apt-get install -qq -y
+