summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-05-30 21:19:54 -0400
committerAndrew Cady <d@jerkface.net>2023-05-30 21:19:54 -0400
commitb9c3866f23d0f21398a4ebb25874546be40225f5 (patch)
tree36064107f4528de88226c1ec03abc80cdc410119 /src
parenta3bfb0fa4c468bdc19a421ae5d5e26fba2d0b597 (diff)
auto init fossil test instances
Diffstat (limited to 'src')
-rw-r--r--src/fossil-init@.service13
-rw-r--r--src/fossil-test@.service4
2 files changed, 16 insertions, 1 deletions
diff --git a/src/fossil-init@.service b/src/fossil-init@.service
new file mode 100644
index 0000000..6e300b0
--- /dev/null
+++ b/src/fossil-init@.service
@@ -0,0 +1,13 @@
1[Unit]
2Description = Create new Fossil repositories on endofossil search path
3ConditionUser = !root
4
5[Service]
6Type = oneshot
7ExecStart = sh -ec '\
8mkdir -p "$HOME"/src; \
9cd "$HOME"/src/"$(dirname "$0")"; \
10fossil=$${0##*/}; \
11[ ! -e "$fossil".fossil ] || exit 0; \
12fossil init ./"$fossil".fossil \
13' "%I"
diff --git a/src/fossil-test@.service b/src/fossil-test@.service
index 56e1a21..1643925 100644
--- a/src/fossil-test@.service
+++ b/src/fossil-test@.service
@@ -24,5 +24,7 @@ ssh-keygen -t ed25519 -f .ssh/id_ed25519 -N ""; \
24ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -- %i@localhost :; \ 24ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -- %i@localhost :; \
25ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -- %i@localhost uptime; \ 25ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -- %i@localhost uptime; \
26cd .ssh; \ 26cd .ssh; \
27fossil clone ssh://%i@localhost/src/fossil/db db~$(date -Ins).fossil; \ 27fossil clone ssh://%i@localhost/fossil-instance-1 db~$(date -Ins).fossil; \
28fossil clone ssh://%i@localhost/a/b/c/fossil-instance-2 db~$(date -Ins).fossil; \
29fossil clone ssh://%i@localhost/fossil/db db~$(date -Ins).fossil; \
28' 30'