aboutsummaryrefslogtreecommitdiff
path: root/ods
diff options
context:
space:
mode:
authorJulien Dessaux2024-09-20 23:14:07 +0200
committerJulien Dessaux2024-09-20 23:15:59 +0200
commit576558adcf00dbf40ed599b9cb11b720bef47b78 (patch)
tree3a24f29c7dcbd80868c183cb3c1e5b18a14af29b /ods
parentUpdated ods deploy job (diff)
downloadev-scripts-576558adcf00dbf40ed599b9cb11b720bef47b78.tar.gz
ev-scripts-576558adcf00dbf40ed599b9cb11b720bef47b78.tar.bz2
ev-scripts-576558adcf00dbf40ed599b9cb11b720bef47b78.zip
Reworked ODS job to handle the necessary git-crypt unlock
Diffstat (limited to '')
-rw-r--r--ods/ods.sh26
-rw-r--r--ods/ods.yaml (renamed from ods/ods-deploy.yaml)22
2 files changed, 38 insertions, 10 deletions
diff --git a/ods/ods.sh b/ods/ods.sh
new file mode 100644
index 0000000..a71e02e
--- /dev/null
+++ b/ods/ods.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+WORKDIR="/tmp/${EVENTLINE_JOB_NAME}"
+
+cleanup() {
+ rm -rf "${WORKDIR}"
+}
+
+trap cleanup EXIT
+
+cd "${WORKDIR}"
+git-crypt unlock "${EVENTLINE_DIR}/identities/gpg/private_key"
+
+podman run --rm -ti -v "${WORKDIR}:/mnt" \
+ --entrypoint "/bin/sh" \
+ localhost/ods:latest \
+ /bin/cp /usr/local/bin/ods /mnt/
+
+SSHKEY="${EVENTLINE_DIR}/identities/ssh/private_key"
+SSHOPTS="-i ${SSHKEY} -o StrictHostKeyChecking=accept-new"
+
+rsync -e "ssh ${SSHOPTS}" "${WORKDIR}/ods" root@ods.adyxax.org:/srv/ods/
+ssh root@ods.adyxax.org "systemctl restart ods"
+
+trap - EXIT
diff --git a/ods/ods-deploy.yaml b/ods/ods.yaml
index 5e96344..5ed5ca8 100644
--- a/ods/ods-deploy.yaml
+++ b/ods/ods.yaml
@@ -1,20 +1,22 @@
-name: "ods-deploy"
+identities:
+ - "gpg"
+ - "ssh"
+name: "ods"
steps:
- label: "git clone"
script:
path: "../common/git-clone.sh"
arguments:
- "https://git.adyxax.org/adyxax/ods"
- - label: "build"
+ - label: "build and deploy"
script:
- path: "../common/make.sh"
- arguments:
- - "container-build"
- - label: "deploy"
- script:
- path: "../common/make.sh"
- arguments:
- - "deploy"
+ path: "./ods.sh"
- label: "clean"
script:
path: "../common/clean.sh"
+runner:
+ identity: "ssh"
+ name: "ssh"
+ parameters:
+ host: "lore.adyxax.org"
+ user: "root"