umorpha-boxes/modules/service-eclipse-follower.sh

55 lines
1.1 KiB
Bash
Raw Normal View History

2024-01-22 19:01:35 +00:00
#!/hint/bash -euE
# Copyright (C) 2024 Umorpha Systems
# SPDX-License-Identifier: AGPL-3.0-or-later
2024-01-22 22:30:22 +00:00
load_module "$(dirname -- "${BASH_SOURCE[0]}")/base-eclipse-creds.sh"
2024-01-22 19:01:35 +00:00
packages+=(
make
pandoc-cli
2024-01-23 02:43:48 +00:00
texlive-core
texlive-latexextra
2024-01-22 19:01:35 +00:00
wdiff
git
lua
2024-01-23 02:43:48 +00:00
lua-dkjson
2024-01-22 19:01:35 +00:00
)
post_install+=(20:eclipse-follower:post_install)
eclipse-follower:post_install() {
local arg_mountpoint=$1
install -Dm755 /dev/stdin "$arg_mountpoint/etc/eclipse/follower.sh" <<-'EOF'
#!/bin/sh
# Copyright (C) 2024 Umorpha Systems
# SPDX-License-Identifier: AGPL-3.0-or-later
set -ex
job=$(eclipse-pick)
eclipse-run "$job"
EOF
install -Dm644 /dev/stdin "$arg_mountpoint/etc/systemd/system/eclipse-follower.service" <<-'EOF'
2024-01-22 19:01:35 +00:00
# Copyright (C) 2024 Umorpha Systems
# SPDX-License-Identifier: AGPL-3.0-or-later
[Unit]
Description=Eclipse CI follower process
Wants=network-online.target
After=network-online.target
2024-01-23 02:43:48 +00:00
StartLimitIntervalSec=0
2024-01-22 19:01:35 +00:00
[Service]
User=eclipse
Group=eclipse
2024-01-22 23:33:44 +00:00
Type=simple
2024-01-22 19:01:35 +00:00
ExecStart=/etc/eclipse/follower.sh
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl --root="$arg_mountpoint" enable eclipse-follower.service
}