I’m not sure what you’re doing exactly so I don’t know the best method to suggest. What I can say is, the same way you would deploy your application now, without CircleCI, is the way you would with CircleCI. Builds run in a Unix environment.
If your production environment is Git based, then git push to deploy. If it’s simply normal files on a filesystem, then use scp or rsync. If it’s Docker based, then log in to the remote machine with ssh, docker stop, docker pull, and docker run.
Thanks for the advice.
Yes I am using git synced to circleci.
Circleci then runs build when git updated.
Update:
Tests use Karma to run. Just discovered that you need to set Karma.conf to singleRun otherwise the tests never end and then blocks the deployment.
So now the deployment completes - get Green build finally.
Hi @FelicianoTech have gotten further now. Thanks for the help.
The latest issue now is that the deployment stops due to ssh key confirmation.
So to date so far:
I have my code on a local dev laptop.
The code is a simple Express app with Docker (also docker-compose).
This gets pushed to Github. This then connects to CircleCi (and DockerHub)
CircleCi runs and passes the tests then starts the deploy and gets stuck.
I am trying to deploy as simple test to my DigitalOcean server.
CircleCi spins up the environment, sets up the ssh,
checks out the code, installs docker-compose, sets up docker engine?
but stops at the deploy.
I think I am getting confused with all the ssh configuration. I am obviously doing something wrong. Anything anyone can do to help me get my head around this issue would be great?
I know this is probably a real simple config problem.
How I see it is that I need somehow to get an ssh key added. So far it has not worked?
It looks like the deploy is connecting to DigitalOcean server but the ssh is failing.
Deployment task: (terminal output)
#!/bin/bash -eo pipefail
if [ "${CIRCLE_BRANCH}" == "node-test-dev" ]; then
ssh $DEPLOY_USER@$DEPLOY_HOST
docker login -u $DOCKER_USER -p DOCKER_PASS
docker run -d cuznerdexter/cuzdex-hub:latest
fi
The authenticity of host 'xx.xxx.xx.xxx' can't be established.
ECDSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)?