diff options
| author | Julian Blake Kongslie | 2020-10-30 16:04:16 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2020-10-30 17:33:31 -0700 |
| commit | 3e2d71d7b135cc6980cc10a4108130236734551e (patch) | |
| tree | ec52715eab33236c10f01ab3f47c913f110ec032 /examples/olamic-run | |
| download | olamic-release/1.tar.xz | |
Initial version.release/1
Diffstat (limited to '')
| -rw-r--r-- | examples/olamic-run | 25 |
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 | |||
| 12 | make | ||
| 13 | make test | ||
| 14 | |||
| 15 | if [[ $GIT_REF =~ ^refs/tags/(.+)$ ]]; then | ||
| 16 | INSTALL_DIR=/srv/app/tag/"${BASH_REMATCH[1]}" | ||
| 17 | elif [[ $GIT_REF =~ ^refs/heads/(.+)$ ]]; then | ||
| 18 | INSTALL_DIR=/srv/app/branch/"${BASH_REMATCH[1]}" | ||
| 19 | fi | ||
| 20 | |||
| 21 | if [[ "${INSTALL_DIR:-}" != "" ]]; then | ||
| 22 | rm -rf "$INSTALL_DIR" | ||
| 23 | mkdir -p "$INSTALL_DIR" | ||
| 24 | make install PREFIX="$INSTALL_DIR" | ||
| 25 | fi | ||
