summaryrefslogtreecommitdiff
path: root/worker
diff options
context:
space:
mode:
Diffstat (limited to 'worker')
-rwxr-xr-xworker/scripts/fetch_code11
1 files changed, 11 insertions, 0 deletions
diff --git a/worker/scripts/fetch_code b/worker/scripts/fetch_code
index cc2d561..3315649 100755
--- a/worker/scripts/fetch_code
+++ b/worker/scripts/fetch_code
@@ -2,6 +2,17 @@
export LOG_PREFIX="[fetch_code $remote @ $checkout -> $path]"
+if [[ "$url" == ssh://* ]]; then
+ host=$(echo "$url" | sed -E 's#ssh://([^:]+):[0-9]+/.*#\1#')
+ port=$(echo "$url" | sed -E 's#ssh://[^:]+:([0-9]+)/.*#\1#')
+
+ log "populating host keyz~ $host:$port"
+ ssh-keyscan -p "$port" "$host" > ./cur_known_hosts
+
+ export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=./cur_known_hosts -o StrictHostKeyChecking=yes"
+ log "GIT_SSH_COMMAND: $GIT_SSH_COMMAND"
+fi
+
log "getting the codez~ time to fetch!"
git clone "$remote" "$path"
if [ ! $? -eq 0 ]; then