M sr.ht/builds.sr.ht/APKBUILD => sr.ht/builds.sr.ht/APKBUILD +10 -3
@@ 28,6 28,8 @@ source="
sr.ht-nginx-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/sr.ht-nginx/archive/master.tar.gz
builds.sr.ht.confd
builds.sr.ht.initd
+ builds.sr.ht-api.confd
+ builds.sr.ht-api.initd
builds.sr.ht-worker.confd
builds.sr.ht-worker.initd
"
@@ 40,20 42,26 @@ build() {
python3 setup.py build
cd worker
go build
+ cd ../api
+ go build
}
package() {
python3 setup.py install --root="$pkgdir" --optimize=1
+ install -Dm755 api/api "$subpkgdir"/usr/bin/builds.sr.ht-api
install -Dm755 "$srcdir"/builds.sr.ht.initd \
"$pkgdir"/etc/init.d/builds.sr.ht
install -Dm644 "$srcdir"/builds.sr.ht.confd \
"$pkgdir"/etc/conf.d/builds.sr.ht
+ install -Dm755 "$srcdir"/builds.sr.ht-api.initd \
+ "$pkgdir"/etc/init.d/builds.sr.ht-api
+ install -Dm644 "$srcdir"/builds.sr.ht-api.confd \
+ "$pkgdir"/etc/conf.d/builds.sr.ht-api
}
_images() {
depends="builds.sr.ht"
pkgdesc="builds.sr.ht build images"
- cd "$builddir"
mkdir -p "$subpkgdir"/var/lib/
cp -R images "$subpkgdir"/var/lib/
}
@@ 61,8 69,7 @@ _images() {
_worker() {
depends="builds.sr.ht-images"
pkgdesc="builds.sr.ht build worker"
- cd "$builddir"/worker
- install -Dm755 worker "$subpkgdir"/usr/bin/builds.sr.ht-worker
+ install -Dm755 worker/worker "$subpkgdir"/usr/bin/builds.sr.ht-worker
install -Dm755 "$srcdir"/builds.sr.ht-worker.initd \
"$subpkgdir"/etc/init.d/builds.sr.ht-worker
install -Dm644 "$srcdir"/builds.sr.ht-worker.confd \
A sr.ht/builds.sr.ht/builds.sr.ht-api.confd => sr.ht/builds.sr.ht/builds.sr.ht-api.confd +8 -0
@@ 0,0 1,8 @@
+# Run the daemon as this user:
+# BUILDS_USER=builds
+
+# Bind the API service to this address:
+# BUILDS_BIND=:5102
+
+# Extra arguments to pass to Gunicorn
+# BUILDS_ARGS=
A sr.ht/builds.sr.ht/builds.sr.ht-api.initd => sr.ht/builds.sr.ht/builds.sr.ht-api.initd +26 -0
@@ 0,0 1,26 @@
+#!/sbin/openrc-run
+name="builds.sr.ht-api"
+description="builds.sr.ht API service"
+supervisor=supervise-daemon
+BUILDS_USER=${BUILDS_USER:-builds}
+BUILDS_BIND=${BUILDS_BIND:-:5102}
+BUILDS_ARGS=${BUILDS_ARGS:-}
+LOCAL_PG=${LOCAL_PG:-yes}
+LOCAL_REDIS=${LOCAL_REDIS:-yes}
+LOGS=/var/log/builds.sr.ht-api.log
+supervise_daemon_args="-1 $LOGS -2 $LOGS"
+command="/usr/bin/buildssrht-api"
+command_args="-b $BUILDS_BIND"
+command_user="$BUILDS_USER:$BUILDS_USER"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+ need net
+ use redis
+ use postgresql
+ use pgbouncer
+}
+
+start_pre() {
+ checkpath -f "$LOGS" -m 644 -o "$BUILDS_USER:$BUILDS_USER"
+}