Answer the question
In order to leave comments, you need to log in
Port 22: Network unreachable or How to make GitLab CI and shared hosting friends?
Hey!
There is a shared hosting that has access to the SSH project folder, but it is issued only for manually specified IPs
. The problem is that gitlab ci cannot connect via SSH
deploy:
stage: deploy
image: alpine
before_script:
- apk add openssh-client
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
script:
- scp -o StrictHostKeyChecking=no public.zip [email protected]$HOST:$PATH_TO_WWW
...
$ eval $(ssh-agent -s)
Agent pid 13
$ echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
Identity added: (stdin) ([email protected])
$ mkdir -p ~/.ssh
$ chmod 700 ~/.ssh
$ scp -o StrictHostKeyChecking=no public.zip [email protected]$HOST:$PATH_TO_WWW
ssh: connect to host ukrcolor.ftp.tools port 22: Network unreachable
lost connection
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
Answer the question
In order to leave comments, you need to log in
Support advises adding an IP from which gitlab ci will come, but there is no open data on the lists.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question