summaryrefslogtreecommitdiff
path: root/examples/olamic-run
diff options
context:
space:
mode:
Diffstat (limited to 'examples/olamic-run')
-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