# vim: set ft=bash : # This is an example olamic-run script for a "typical" app # Olamic scripts are run under /bin/bash with "set -eux -o pipefail" in effect # Variables provided by olamic # GIT_OBJECT The git commit that was cloned # GIT_REF The ref that triggered this run (post-receive hook) # GIT_REPO The path to the git repo # TASK_ID UUID for this olamic run make make test if [[ $GIT_REF =~ ^refs/tags/(.+)$ ]]; then INSTALL_DIR=/srv/app/tag/"${BASH_REMATCH[1]}" elif [[ $GIT_REF =~ ^refs/heads/(.+)$ ]]; then INSTALL_DIR=/srv/app/branch/"${BASH_REMATCH[1]}" fi if [[ "${INSTALL_DIR:-}" != "" ]]; then rm -rf "$INSTALL_DIR" mkdir -p "$INSTALL_DIR" make install PREFIX="$INSTALL_DIR" fi