diff options
author | Andrew Cady <d@jerkface.net> | 2023-05-30 21:19:54 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2023-05-30 21:19:54 -0400 |
commit | b9c3866f23d0f21398a4ebb25874546be40225f5 (patch) | |
tree | 36064107f4528de88226c1ec03abc80cdc410119 /src | |
parent | a3bfb0fa4c468bdc19a421ae5d5e26fba2d0b597 (diff) |
auto init fossil test instances
Diffstat (limited to 'src')
-rw-r--r-- | src/fossil-init@.service | 13 | ||||
-rw-r--r-- | src/fossil-test@.service | 4 |
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] | ||
2 | Description = Create new Fossil repositories on endofossil search path | ||
3 | ConditionUser = !root | ||
4 | |||
5 | [Service] | ||
6 | Type = oneshot | ||
7 | ExecStart = sh -ec '\ | ||
8 | mkdir -p "$HOME"/src; \ | ||
9 | cd "$HOME"/src/"$(dirname "$0")"; \ | ||
10 | fossil=$${0##*/}; \ | ||
11 | [ ! -e "$fossil".fossil ] || exit 0; \ | ||
12 | fossil 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 ""; \ | |||
24 | ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -- %i@localhost :; \ | 24 | ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -- %i@localhost :; \ |
25 | ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -- %i@localhost uptime; \ | 25 | ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -- %i@localhost uptime; \ |
26 | cd .ssh; \ | 26 | cd .ssh; \ |
27 | fossil clone ssh://%i@localhost/src/fossil/db db~$(date -Ins).fossil; \ | 27 | fossil clone ssh://%i@localhost/fossil-instance-1 db~$(date -Ins).fossil; \ |
28 | fossil clone ssh://%i@localhost/a/b/c/fossil-instance-2 db~$(date -Ins).fossil; \ | ||
29 | fossil clone ssh://%i@localhost/fossil/db db~$(date -Ins).fossil; \ | ||
28 | ' | 30 | ' |