blueprints.git

commit f69ca96a672013bceb6de5b65c1cca4dcb65be30

Author: Adam <git@apiote.xyz>

smithy

 smithy/Dockerfile | 9 +++++++++
 smithy/build.sh | 17 +++++++++++++++++


diff --git a/smithy/Dockerfile b/smithy/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..8d3d479ca273fb21441d49cdc0c6c1850c0f7e79
--- /dev/null
+++ b/smithy/Dockerfile
@@ -0,0 +1,9 @@
+FROM alpine
+RUN apk add git go openssh-client make
+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/smithy/build.sh b/smithy/build.sh
new file mode 100755
index 0000000000000000000000000000000000000000..aa0e93786a2d241133214fd3e34861ef41039ddf
--- /dev/null
+++ b/smithy/build.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -ex
+
+item="$1"
+
+git clone https://git.apiote.xyz/git/smithy.git
+cd smithy
+TAG=$(git tag | sort -V | tail -n1)
+git checkout "$TAG"
+make
+scp smithy "deploy@host.containers.internal:toys/smithy/${item}/smithy-${TAG}"
+ssh deploy@host.containers.internal "cp ~/toys/smithy/${item}/smithy-${TAG} /tmp/smithy"
+ssh deploy@host.containers.internal "chmod a+rwX /tmp/smithy"
+ssh deploy@host.containers.internal "doas cp /tmp/smithy /usr/bin/smithy"
+ssh deploy@host.containers.internal "rm /tmp/smithy"
+ssh deploy@host.containers.internal "doas -u www doas /etc/init.d/smithy restart"