File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 1
1
FROM alpine:3.10.3
2
2
3
- RUN apk add --no-cache git bash openssh
3
+ RUN apk add --no-cache git~=2.22 bash openssh
4
4
5
5
# install git-lfs
6
6
RUN apk add --no-cache --virtual deps openssl && \
Original file line number Diff line number Diff line change @@ -40,12 +40,8 @@ set -e
40
40
41
41
[ -z " $REVISION " ] && (echo " missing REVISION var" | tee /dev/stderr) && exit 1
42
42
43
- # Condition should be based on $REPO url format, not $PRIVATE_KEY. Need to fix regex.
44
- # SSH_CLONE=""
45
43
46
- # echo "$REPO" | grep -Eq "^git.*?@.*?:(?:.*?\/)?.*?\/.*?\.git$" && SSH_CLONE=true
47
- # if [ -n $SSH_CLONE ]
48
- if [ -n " $PRIVATE_KEY " ]; then
44
+ if [ " $USE_SSH " = " true" ]; then
49
45
echo " Cloning using SSH: $REPO "
50
46
51
47
[ -z " $PRIVATE_KEY " ] && (echo " missing PRIVATE_KEY var" | tee /dev/stderr) && exit 1
@@ -54,8 +50,9 @@ if [ -n "$PRIVATE_KEY" ]; then
54
50
chmod 700 ~ /.ssh/
55
51
chmod 600 ~ /.ssh/*
56
52
57
- # git@github.com:username/repo.git
53
+ # ssh:// git@github.com:username/repo.git
58
54
# match "github.com" from ssh uri
55
+ REPO=${REPO# " ssh://" }
59
56
SSH_HOST=$( echo " $REPO " | cut -d " :" -f 1 | cut -d " @" -f 2)
60
57
61
58
echo " Adding " $SSH_HOST " to known_hosts"
You can’t perform that action at this time.
0 commit comments