blueprints.git

commit 3fa8539f505c3cf8a737f6387fe1e53bb21fc7c8

Author: Adam <git@apiote.xyz>

add bimba server

 bimba_server/Dockerfile | 10 ++++++++++
 bimba_server/build.sh | 19 +++++++++++++++++++


diff --git a/bimba_server/Dockerfile b/bimba_server/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..4ab0af30079d52b3572ddd3c2ed39d053eb8b0c9
--- /dev/null
+++ b/bimba_server/Dockerfile
@@ -0,0 +1,10 @@
+FROM alpine
+RUN apk add git plan9port tar xz go openssh-client
+RUN ln -s /usr/lib/plan9/bin/mk /usr/bin/mk
+WORKDIR /root
+RUN mkdir .ssh
+COPY ssh_key .ssh/id_ed25519
+COPY known_hosts .ssh/known_hosts
+COPY build.sh build.sh
+RUN chmod 755 build.sh
+ENTRYPOINT ["./build.sh"]




diff --git a/bimba_server/build.sh b/bimba_server/build.sh
new file mode 100755
index 0000000000000000000000000000000000000000..638afcca553df7f0b94424596b857092d57bf2ba
--- /dev/null
+++ b/bimba_server/build.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -ex
+
+item="$1"
+
+git clone https://git.apiote.xyz/git/bimba_server.git
+cd bimba_server
+mk
+tar cf bimba_server.txz bimba_server
+commit=$(git show --pretty=oneline --abbrev-commit --name-only | head -n1 | cut -d ' ' -f 1)
+timestamp=$(date '+%Y%m%dT%H%M')
+scp bimba_server.txz deploy@host.containers.internal:toys/bimba_server/${item}/bimba_server_${timestamp}_${commit}.txz
+ssh deploy@host.containers.internal "cp ~/toys/bimba_server/${item}/bimba_server_${timestamp}_${commit}.txz /tmp/bimba_server.txz"
+ssh deploy@host.containers.internal "chmod a+rwX /tmp/bimba_server.txz"
+ssh deploy@host.containers.internal "doas -u www cp /tmp/bimba_server.txz /var/www/bimba"
+ssh deploy@host.containers.internal "rm /tmp/bimba_server.txz"
+ssh deploy@host.containers.internal "doas -u www tar xavf /var/www/bimba/bimba_server.txz -C /var/www/bimba/"
+ssh deploy@host.containers.internal "doas -u www doas /etc/init.d/bimba restart"