diff options
author | Elizabeth Hunt <me@liz.coffee> | 2025-07-01 12:55:10 -0700 |
---|---|---|
committer | Elizabeth Hunt <me@liz.coffee> | 2025-07-01 12:55:10 -0700 |
commit | 218cfa957712e488a215cf612649d6d890f9c862 (patch) | |
tree | fc7ace9beee59f55748d6b3d6b437c34f0e1b7fc /worker/scripts | |
parent | 6b5cad9dc4ad9135a347d7dec119d533f7f02fa2 (diff) | |
download | ci-218cfa957712e488a215cf612649d6d890f9c862.tar.gz ci-218cfa957712e488a215cf612649d6d890f9c862.zip |
Fixing fetch_code script
Diffstat (limited to 'worker/scripts')
-rwxr-xr-x | worker/scripts/fetch_code | 11 |
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 |