summaryrefslogtreecommitdiff
path: root/worker/scripts/fetch_code
diff options
context:
space:
mode:
Diffstat (limited to 'worker/scripts/fetch_code')
-rwxr-xr-xworker/scripts/fetch_code15
1 files changed, 15 insertions, 0 deletions
diff --git a/worker/scripts/fetch_code b/worker/scripts/fetch_code
index d45f6db..d3af763 100755
--- a/worker/scripts/fetch_code
+++ b/worker/scripts/fetch_code
@@ -1,6 +1,21 @@
#!/bin/bash
+export LOG_PREFIX="[fetch_code $remote @ $checkout -> $path]"
+
+log "fetch!"
git clone "$remote" "$path"
+if [ ! $? -eq 0 ]; then
+ log "D: failed to clone"
+ exit 1
+fi
+
cd "$path"
+log "checkout $checkout"
git reset --hard "$checkout"
+if [ ! $? -eq 0 ]; then
+ log "D: can't reset to $checkout"
+ cd -
+ exit 1
+fi
+
cd -