summaryrefslogtreecommitdiff
path: root/firehose.configure
blob: c17fe599a78c46edf25df4cf254174cde4c58fc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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