aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Dessaux2022-09-05 00:04:35 +0200
committerJulien Dessaux2022-09-05 23:51:17 +0200
commit29e6c829e3259bcf856b00ecb2137a3ad4676271 (patch)
treedb9833ee0df2f6f051ba38d3d1ae2e5425bd62b1
parentRemoved hello and added ev-scripts deploy (diff)
downloadev-scripts-29e6c829e3259bcf856b00ecb2137a3ad4676271.tar.gz
ev-scripts-29e6c829e3259bcf856b00ecb2137a3ad4676271.tar.bz2
ev-scripts-29e6c829e3259bcf856b00ecb2137a3ad4676271.zip
Factorised ev-scripts-deploy in a generic git clone && make run
-rw-r--r--common/make-run.sh15
-rw-r--r--eventline/ev-scripts-deploy.sh15
-rw-r--r--eventline/ev-scripts-deploy.yaml13
3 files changed, 27 insertions, 16 deletions
diff --git a/common/make-run.sh b/common/make-run.sh
new file mode 100644
index 0000000..8c719b2
--- /dev/null
+++ b/common/make-run.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+WORKDIR="/tmp/${NAME}"
+
+cleanup() {
+ cd /
+ rm -rf "${WORKDIR}"
+}
+
+trap cleanup EXIT
+
+git clone -q "${URL}" "${WORKDIR}"
+cd "${WORKDIR}"
+make run
diff --git a/eventline/ev-scripts-deploy.sh b/eventline/ev-scripts-deploy.sh
deleted file mode 100644
index c6b6f0d..0000000
--- a/eventline/ev-scripts-deploy.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-
-WORKDIR="/tmp/ev-scripts-deploy"
-
-cleanup() {
- cd
- rm -rf ${WORKDIR}
-}
-
-trap cleanup EXIT
-
-git clone -q --depth 1 https://git.adyxax.org/adyxax/ev-scripts.git ${WORKDIR}
-cd ${WORKDIR}
-make run
diff --git a/eventline/ev-scripts-deploy.yaml b/eventline/ev-scripts-deploy.yaml
index 3dd5d2a..e01c567 100644
--- a/eventline/ev-scripts-deploy.yaml
+++ b/eventline/ev-scripts-deploy.yaml
@@ -1,4 +1,15 @@
name: "ev-scripts-deploy"
steps:
- script:
- path: "ev-scripts-deploy.sh"
+ path: "../common/make-run.sh"
+identities:
+ - eventline-self
+parameters:
+- name: name
+ type: string
+ default: "ev-scripts-deploy"
+ environment: NAME
+- name: url
+ type: string
+ default: "https://git.adyxax.org/adyxax/ev-scripts"
+ environment: URL