From 7965ebf71bf3270a30eff3cbb842c6c609c3dec9 Mon Sep 17 00:00:00 2001 From: Lauren Perry Date: Fri, 9 Jan 2015 17:46:09 +0000 Subject: Perform firehose.configure commands in deployed system, not development --- firehose.configure | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/firehose.configure b/firehose.configure index 27a5fe6..7d129dd 100644 --- a/firehose.configure +++ b/firehose.configure @@ -3,30 +3,35 @@ set -e ROOT="$1" +# Add firehose user +chroot "$ROOT" adduser "$GERRIT_USER" -s /bin/false -D +chroot "$ROOT" sudo -u "$GERRIT_USER" --ssh-keygen -C "$GERRIT_USER@baserock.org" -N "" +chroot "$ROOT" sudo chown -R "$GERRIT_USER":"$GERRIT_USER" /var/lib/firehose +cd "$ROOT/home/firehose/" + # Clone the Firehose repo (temporary hack) git clone git://git.baserock.org/baserock/baserock/firehose # Move Firehose arguments to specific directory and timer/service # files to /etc/systemd -mkdir -p "$ROOT"/var/lib/firehose -cd firehose/ -cp examples/*.yaml "$ROOT"/var/lib/firehose/ -cp firehose.service "$ROOT"/etc/systemd/system/firehose.service -cp firehose.timer "$ROOT"/etc/systemd/system/firehose.timer +mkdir -p "$ROOT/var/lib/firehose" +cp examples/*.yaml "$ROOT/var/lib/firehose/" +cp firehose.service "$ROOT/etc/systemd/system/firehose.service" +cp firehose.timer "$ROOT/etc/systemd/system/firehose.timer" # Run the Firehose install script -/usr/bin/python ./setup.py install +chroot "$ROOT" /usr/bin/python ./setup.py install -cat >>"$ROOT"/etc/morph.conf <>"$ROOT/etc/morph.conf" <>"$ROOT"/etc/firehose.conf <>"$ROOT/etc/firehose.conf" <>"$ROOT/home/firehose/.gitconfig" <