So I am trying to run a more sophisticated command with SSH, but no matter what my command is (even if I only add the git clone command), my workflow keeps saying it’s busy with the job “deploy over ssh” until it receives a time-out.
Now I tested the command from my own machine and it works quite well. I have added the SSH key of my server to my project and configured ssh for Github on my server. So it should work fine, but I’m already struggling all night to get this working.
Any help is much appreciated.
# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
jobs:
deploy:
machine:
enabled: true
steps:
- add_ssh_keys:
fingerprints:
- "1f:bd:2c:20:79:af:b4:92:06:b0:e9:50:9d:5e:fa:46"
- run:
name: Deploy Over SSH
command: |-
ssh $SSH_USER@$SSH_HOST 'bash -c CURRDATE=$(date +%s);echo \$CURRDATE; cd /var/www/mydomain.com/releases && \
git clone git@github.com:GithubUser/mydomain.com.git \$CURRDATE && \
cd \$CURRDATE && \
git checkout develop && \
ln -s /var/www/mydomain.com/releases/\$CURRDATE /var/www/mydomain.com/current"'
workflows:
build-and-deploy:
jobs:
- deploy:
filters:
branches:
only:
- master # only deploy on the master branch
- develop
EDIT:
Now I even tried this very simple command, and fails as well, the task keeps running until a time-out occurs.
ssh $SSH_USER@$SSH_HOST 'touch /var/www/mydomain.com/releases/test.txt'