diff options
Diffstat (limited to 'firehose.configure')
-rw-r--r-- | firehose.configure | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/firehose.configure b/firehose.configure new file mode 100644 index 0000000..c17fe59 --- /dev/null +++ b/firehose.configure @@ -0,0 +1,40 @@ +#!/bin/sh +set -e + +ROOT="$1" + +# Clone the Firehose repo +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 + +# Run the Firehose install script +/usr/bin/python ./setup.py install + +cat >>"$ROOT"/etc/morph.conf <<EOF +[config] +repo-alias=baserock=git://git.baserock.org/baserock/#ssh://firehose@testgerrit.baserock.org:29418/baserock/,upstream=git://git.baserock.org/delta/#ssh://firehose@testgerrit.baserock.org:29418/delta/ +EOF + +# This will run Firehose on the argument specified in firehose.timer +# automatically every six hours +systemctl enable firehose.timer +systemctl start firehose.timer +systemctl enable firehose.service + +# Add firehose user, then become firehose user +adduser firehose -s /bin/false -D +sudo -u firehose --ssh-keygen -C "firehose@baserock.org" -N "" +sudo chown -R firehose:firehose /var/lib/firehose/ +sudo -u firehose -s + +# Configure a git identity for Firehose +git config --global user.name "Firehose" +git config --global user.email firehose@firehose.baserock.org + |