#!/hint/bash -euE # Copyright (C) 2024 Umorpha Systems # SPDX-License-Identifier: AGPL-3.0-or-later load_module "$(dirname -- "${BASH_SOURCE[0]}")/base-nginx.sh" post_install+=(20:eclipse-leader:post_install) eclipse-leader:post_install() { local arg_mountpoint=$1 systemctl --root="$arg_mountpoint" enable eclipse-httpd.socket systemctl --root="$arg_mountpoint" enable eclipse-trigger.timer install -Dm644 /dev/stdin "$arg_mountpoint/etc/systemd/system/eclipse-trigger.service.d/env.conf.conf" <<-'EOF' # Copyright (C) 2024 Umorpha Systems # SPDX-License-Identifier: AGPL-3.0-or-later [Service] Environment="GIT_SSH_COMMAND=ssh -i /etc/umorpha-secrets/eclipse-sshkey.priv" EOF install -Dm644 /dev/stdin "$arg_mountpoint/etc/nginx/sites/ci.conf" <<-'EOF' # -*- mode: nginx; nginx-indent-level: 4; intent-tabs-mode: nil -*- server { server_name ci.mothstuff.lol; include /etc/nginx/snippets/listen.conf; location / { proxy_pass http://unix:/run/eclipse-httpd.socket; proxy_request_buffering off; } } EOF install -Dm644 /dev/stdin "$arg_mountpoint/etc/eclipse/triggers.d/pitch.yml" <<-'EOF' - triggers: - repo_url: gitea@git.mothstuff.lol:lukeshu/pitch.git rev: HEAD run: | set -ex git clone gitea@git.mothstuff.lol:lukeshu/pitch.git cd pitch make cp -v *.pdf "$ECLIPSE_ARTIFACTSDIR" EOF install -Dm644 /dev/stdin "$arg_mountpoint/etc/eclipse/triggers.d/business-plan.yml" <<-'EOF' - triggers: - repo_url: gitea@git.mothstuff.lol:jp/business-plan.git rev: HEAD run: | set -ex git clone gitea@git.mothstuff.lol:jp/business-plan.git cd business-plan make cp -v *.pdf "$ECLIPSE_ARTIFACTSDIR" EOF }