diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-03-25 15:02:07 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-03-26 17:35:43 +0000 |
commit | 4e5378031a9369cdb430586fbd3daab0bf35f9cc (patch) | |
tree | b94586dbe5379f34d84d2c45aa9a4d92b07e08fa /distbuild.configure | |
parent | 9842ea3c643b93d8adf85cccc733e1e596c9cc90 (diff) | |
download | definitions-4e5378031a9369cdb430586fbd3daab0bf35f9cc.tar.gz |
Install distbuild files in distbuild.configurebaserock/pedroalvarez/improve-distbuild-deployment
Change-Id: If0f154354ddadc77603072fda72cda3a0a2aa480
Diffstat (limited to 'distbuild.configure')
-rw-r--r-- | distbuild.configure | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/distbuild.configure b/distbuild.configure index 062aaecc..1499c679 100644 --- a/distbuild.configure +++ b/distbuild.configure @@ -40,6 +40,44 @@ set -e +ROOT="$1" + +########################################################################## +# Copy Distbuild files into root filesystem +########################################################################## + +mkdir -p "$ROOT"/usr/share/distbuild-setup +for file in morph.conf morph-cache-server.conf morph-controller.conf \ + morph-controller-helper.conf morph-worker.conf morph-worker-helper.conf; do + + cp distbuild/usr/share/distbuild-setup/$file \ + "$ROOT"/usr/share/distbuild-setup/ +done + + +mkdir -p "$ROOT"/usr/lib/distbuild-setup/ansible +for file in hosts distbuild-setup; do + + cp distbuild/usr/lib/distbuild-setup/ansible/$file \ + "$ROOT"/usr/lib/distbuild-setup/ansible/ +done + + +mkdir -p "$ROOT"/usr/lib/systemd/system/ +for file in morph-cache-server.service morph-controller.service \ + morph-controller-helper.service morph-worker.service \ + morph-worker-helper.service distbuild-setup.service; do + + cp distbuild/usr/lib/systemd/system/$file \ + "$ROOT"/usr/lib/systemd/system/ +done + +ln -s ../distbuild-setup.service "$ROOT"/etc/systemd/system/multi-user.target.wants/distbuild-setup.service + +########################################################################## +# Check variables +########################################################################## + if [ -n "$DISTBUILD_GENERIC" ]; then echo "Not configuring the distbuild node, it will be generic" exit 0 @@ -95,20 +133,19 @@ if "$error_vars"; then fi -ROOT="$1" +########################################################################## +# Generate configuration for the distbuild node +########################################################################## DISTBUILD_DATA="$ROOT/etc/distbuild" mkdir -p "$DISTBUILD_DATA" -# If it's a worker, install the worker ssh key. if [ "$DISTBUILD_WORKER" = True ] then install -m 0644 "$WORKER_SSH_KEY" "$DISTBUILD_DATA/worker.key" fi - -# Create the configuration file python <<'EOF' >"$DISTBUILD_DATA/distbuild.conf" import os, sys, yaml |