diff options
Diffstat (limited to '')
| -rwxr-xr-x | examples/olamic-githook-post-receive | 8 | ||||
| -rwxr-xr-x | olamic-worker | 25 |
2 files changed, 17 insertions, 16 deletions
diff --git a/examples/olamic-githook-post-receive b/examples/olamic-githook-post-receive index 3135d0d..4c71703 100755 --- a/examples/olamic-githook-post-receive +++ b/examples/olamic-githook-post-receive | |||
| @@ -11,13 +11,9 @@ while read OLD NEW REF; do | |||
| 11 | OLAMIC_EMAIL="$(git show --no-patch --format=%ae "$NEW")" | 11 | OLAMIC_EMAIL="$(git show --no-patch --format=%ae "$NEW")" |
| 12 | echo -n "Enqueuing olamic run for $REF: " | 12 | echo -n "Enqueuing olamic run for $REF: " |
| 13 | if [[ "$OLAMIC_QUEUE_HOST" == "" ]]; then | 13 | if [[ "$OLAMIC_QUEUE_HOST" == "" ]]; then |
| 14 | olamic-enqueue "$OLAMIC_QUEUE_DIR" "$OLAMIC_GIT_REPO" "$NEW" GIT_REF="$REF" OLAMIC_EMAIL="$OLAMIC_EMAIL" <<END | 14 | git show "$NEW":olamic-run | olamic-enqueue "$OLAMIC_QUEUE_DIR" "$OLAMIC_GIT_REPO" "$NEW" GIT_REF="$REF" OLAMIC_EMAIL="$OLAMIC_EMAIL" |
| 15 | . ./olamic-run | ||
| 16 | END | ||
| 17 | else | 15 | else |
| 18 | ssh "$OLAMIC_QUEUE_HOST" olamic-enqueue "$OLAMIC_QUEUE_DIR" "$OLAMIC_GIT_REPO" "$NEW" GIT_REF="$REF" OLAMIC_EMAIL="$OLAMIC_EMAIL" <<END | 16 | git show "$NEW":olamic-run | ssh "$OLAMIC_QUEUE_HOST" olamic-enqueue "$OLAMIC_QUEUE_DIR" "$OLAMIC_GIT_REPO" "$NEW" GIT_REF="$REF" OLAMIC_EMAIL="$OLAMIC_EMAIL" |
| 19 | . ./olamic-run | ||
| 20 | END | ||
| 21 | fi | 17 | fi |
| 22 | fi | 18 | fi |
| 23 | done | 19 | done |
diff --git a/olamic-worker b/olamic-worker index 942151a..c9a1bd0 100755 --- a/olamic-worker +++ b/olamic-worker | |||
| @@ -31,21 +31,26 @@ while true; do | |||
| 31 | 31 | ||
| 32 | set +e | 32 | set +e |
| 33 | ( | 33 | ( |
| 34 | set -ex | 34 | set -e |
| 35 | 35 | ||
| 36 | GIT_DIR=cache.git git fetch "$GIT_REPO" "$GIT_OBJECT" | 36 | ( |
| 37 | set -x | ||
| 38 | |||
| 39 | GIT_DIR=cache.git git fetch "$GIT_REPO" "$GIT_OBJECT" | ||
| 37 | 40 | ||
| 38 | rm -rf work | 41 | rm -rf work |
| 39 | mkdir work | 42 | mkdir work |
| 40 | cd work | 43 | cd work |
| 41 | 44 | ||
| 42 | git clone --shared "$OLAMIC_WORKER_DIR"/cache.git checkout | 45 | git clone --shared "$OLAMIC_WORKER_DIR"/cache.git checkout |
| 43 | cd checkout | 46 | cd checkout |
| 44 | git config advice.detachedHead false | 47 | git config advice.detachedHead false |
| 45 | git checkout -f "$GIT_OBJECT" | 48 | git checkout -f "$GIT_OBJECT" |
| 49 | ) | ||
| 46 | 50 | ||
| 47 | ( | 51 | ( |
| 48 | eval "$TASK_SCRIPT" | 52 | cd work/checkout |
| 53 | eval "set -x; $TASK_SCRIPT" | ||
| 49 | ) | 54 | ) |
| 50 | ) 2>&1 | tee log | 55 | ) 2>&1 | tee log |
| 51 | STATUS="$?" | 56 | STATUS="$?" |
