diff options
author | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-11 15:36:49 -0700 |
---|---|---|
committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-11 16:17:23 -0700 |
commit | b241180aa85ad81f4ee0dca9bf3c0429916a6a18 (patch) | |
tree | 91bac564261b210517297daf3e4937e11e4001aa /worker/scripts/fetch_code | |
parent | aff695a1ff160d9e3045fbdf832c95db732c0f89 (diff) | |
download | ci-b241180aa85ad81f4ee0dca9bf3c0429916a6a18.tar.gz ci-b241180aa85ad81f4ee0dca9bf3c0429916a6a18.zip |
Significantly improve traceability and minor fixes.
Diffstat (limited to 'worker/scripts/fetch_code')
-rwxr-xr-x | worker/scripts/fetch_code | 15 |
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 - |