Commit
+38 -0 +/-1 browse
1 | diff --git a/contrib/systemd/user/ayllu-job-template@.service b/contrib/systemd/user/ayllu-job-template@.service |
2 | new file mode 100644 |
3 | index 0000000..3effa52 |
4 | --- /dev/null |
5 | +++ b/contrib/systemd/user/ayllu-job-template@.service |
6 | @@ -0,0 +1,38 @@ |
7 | + # A oneshot systemd unit template for running ayllu jobs after updating a repository. |
8 | + # You can use it as a post-receive hook in your repo's hooks/ directory. |
9 | + # Do not forget to set the hook file as executable! |
10 | + # |
11 | + # How to use: |
12 | + # - Add to systemd's configuration paths, e.g. $HOME/.config/systemd/user/ or /etc/systemd/user/ |
13 | + # - Run `systemctl --user daemon-reload` |
14 | + # - To execute the job, run: |
15 | + # systemctl --user start ayllu-job-template@`systemd-escape "$(pwd)"`.service |
16 | + # if your current directory is the repository directory. Otherwise replace |
17 | + # `$(pwd)` with a variable `${VAR}` which holds the path to the repository: |
18 | + # export VAR=/home/user/repos/user/repo/; \ |
19 | + # systemctl --user start ayllu-job-template@`systemd-escape "${VAR}"`.service |
20 | + # |
21 | + # Copyright 2024 Emmanouil Pitsidianakis <manos@pitsidianak.is> |
22 | + # SPDX-License-Identifier: EUPL-1.2 OR GPL-3.0-or-later |
23 | + |
24 | + [Unit] |
25 | + Description=Ayllu job post-receive hook for %I |
26 | + StartLimitIntervalSec=60 |
27 | + StartLimitBurst=5 |
28 | + |
29 | + [Service] |
30 | + WantedBy=default.target |
31 | + Type=oneshot |
32 | + RemainAfterExit=no |
33 | + TimeoutStartSec=5 |
34 | + ExecStart=/usr/bin/ayllu jobs run "%I" |
35 | + KillSignal=SIGTERM |
36 | + Restart=on-failure |
37 | + RestartSec=12 |
38 | + RestartSteps=60 |
39 | + RestartMaxDelaySec=3600 |
40 | + OOMPolicy=kill |
41 | + RuntimeMaxSec=3600 |
42 | + |
43 | + [Install] |
44 | + WantedBy=default.target |