summaryrefslogtreecommitdiff
path: root/examples/olamic-run
diff options
context:
space:
mode:
authorJulian Blake Kongslie2020-10-30 16:04:16 -0700
committerJulian Blake Kongslie2020-10-30 17:33:31 -0700
commit3e2d71d7b135cc6980cc10a4108130236734551e (patch)
treeec52715eab33236c10f01ab3f47c913f110ec032 /examples/olamic-run
downloadolamic-release/1.tar.xz
Initial version.release/1
Diffstat (limited to '')
-rw-r--r--examples/olamic-run25
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/olamic-run b/examples/olamic-run
new file mode 100644
index 0000000..eebcfb5
--- /dev/null
+++ b/examples/olamic-run
@@ -0,0 +1,25 @@
1# vim: set ft=bash :
2
3# This is an example olamic-run script for a "typical" app
4# Olamic scripts are run under /bin/bash with "set -eux -o pipefail" in effect
5
6# Variables provided by olamic
7# GIT_OBJECT The git commit that was cloned
8# GIT_REF The ref that triggered this run (post-receive hook)
9# GIT_REPO The path to the git repo
10# TASK_ID UUID for this olamic run
11
12make
13make test
14
15if [[ $GIT_REF =~ ^refs/tags/(.+)$ ]]; then
16 INSTALL_DIR=/srv/app/tag/"${BASH_REMATCH[1]}"
17elif [[ $GIT_REF =~ ^refs/heads/(.+)$ ]]; then
18 INSTALL_DIR=/srv/app/branch/"${BASH_REMATCH[1]}"
19fi
20
21if [[ "${INSTALL_DIR:-}" != "" ]]; then
22 rm -rf "$INSTALL_DIR"
23 mkdir -p "$INSTALL_DIR"
24 make install PREFIX="$INSTALL_DIR"
25fi