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

59 lines
1.7 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
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
2024-01-22 19:18:56 +00:00
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
2024-01-22 19:01:35 +00:00
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:
2024-01-22 19:18:56 +00:00
- repo_url: gitea@git.mothstuff.lol:lukeshu/pitch.git
2024-01-22 19:01:35 +00:00
rev: HEAD
run: |
set -ex
2024-01-22 19:18:56 +00:00
git clone gitea@git.mothstuff.lol:lukeshu/pitch.git
2024-01-22 19:01:35 +00:00
cd pitch
make
cp -v *.pdf "$ECLIPSE_ARTIFACTSDIR"
EOF
install -Dm644 /dev/stdin "$arg_mountpoint/etc/eclipse/triggers.d/business-plan.yml" <<-'EOF'
- triggers:
2024-01-22 19:18:56 +00:00
- repo_url: gitea@git.mothstuff.lol:jp/business-plan.git
2024-01-22 19:01:35 +00:00
rev: HEAD
run: |
set -ex
2024-01-22 19:18:56 +00:00
git clone gitea@git.mothstuff.lol:jp/business-plan.git
2024-01-22 19:01:35 +00:00
cd business-plan
make
cp -v *.pdf "$ECLIPSE_ARTIFACTSDIR"
EOF
}