~sircmpwn/sr.ht-packages

sr.ht-pkgbuilds: builds.sr.ht: Add api service v1 APPLIED

Thorben Günther: 1
 builds.sr.ht: Add api service

 2 files changed, 21 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/sr.ht-packages/patches/22502/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH sr.ht-pkgbuilds] builds.sr.ht: Add api service Export this patch

---
 builds.sr.ht/PKGBUILD                 | 10 ++++++++--
 builds.sr.ht/builds.sr.ht-api.service | 13 +++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 builds.sr.ht/builds.sr.ht-api.service
diff --git a/builds.sr.ht/PKGBUILD b/builds.sr.ht/PKGBUILD
index 4e1ef1d..448f233 100644
--- a/builds.sr.ht/PKGBUILD
@@ -1,6 +1,6 @@
pkgbase=builds.sr.ht
pkgname=(builds.sr.ht builds.sr.ht-images builds.sr.ht-worker)
pkgver=0.63.10
pkgver=0.68.3
pkgrel=2
arch=("x86_64")
license=("AGPL3")
@@ -10,11 +10,13 @@ source=(
	"$pkgbase-$pkgver.tar.gz::http://git.sr.ht/~sircmpwn/$pkgbase/archive/$pkgver.tar.gz"
	"builds.sr.ht.service"
	"builds.sr.ht-worker.service"
	"builds.sr.ht-api.service"
	"sysusers.conf"
)
sha256sums=('1aeef7f492052c77fd4e9208621777059cac907d4df1d732d6e1aadbff63040b'
sha256sums=('f9b129dffa5a379e3db676916a1b0dfe1324b608f6d04a3c66c53d7b871f24f2'
            '95be67b46e8064376b8146a25780578250f53bf11bef790f95aae77e76a3fe22'
            'eee2c75cd45b7bf77eabe2687d4bb01ab3a66732977f01887a1d947d0a68c3d0'
            '50f4f9d6b32ff6482b6ca046721a48896a81a98a6c4fe2b8f3f0fc1884d21c2b'
            '7d195dab1daa69ceb29c78eeae60b0fc332b255e96f33c01d5f906eaacaed541')
export PKGVER=$pkgver

@@ -23,6 +25,8 @@ build() {
	python3 setup.py build
	cd worker
	go build
	cd ../api
	go build -o buildssrht-api
}

package_builds.sr.ht() {
@@ -45,7 +49,9 @@ package_builds.sr.ht() {
	mkdir -p "$pkgdir"/usr/lib/systemd/system/

	install -Dm644 ../builds.sr.ht.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm644 ../builds.sr.ht-api.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/builds.sr.ht.conf"
	install -Dm755 api/buildssrht-api "$pkgdir"/usr/bin/buildssrht-api

	# Contrib scripts
	mkdir -p "$pkgdir"/usr/bin/builds.sr.ht
diff --git a/builds.sr.ht/builds.sr.ht-api.service b/builds.sr.ht/builds.sr.ht-api.service
new file mode 100644
index 0000000..b7b4748
--- /dev/null
@@ -0,0 +1,13 @@
[Unit]
Description=builds.sr.ht API service
Requires=redis.service postgresql.service
After=redis.service postgresql.service network.target

[Service]
Type=simple
User=buildsrht
Restart=always
ExecStart=/usr/bin/buildssrht-api -b :5102

[Install]
WantedBy=multi-user.target
-- 
2.31.1