Deploying to server using existing scripts

Sorry, but I have a very entry level question… I am still exploring deployment and CI options.

Simple Linux hosted cloud server setup. I have an existing, custom deployment shell script (per server: stage, preview, live). So to deploy the application, I simply SSH into the server and run something like… ~/sites/live/

I’m interested in knowing if Circle CI can run this script without having an agent installed on the server. Essentially either remotely SSHing into the server to run the script, or running as a simple website on the server.

Apologies if this is a misguided question, and thanks!

Hello @illustrationism

I am not sure I exactly followed with the last half of your question there but I believe overall the answer is yes. If you do X locally, you should be able to do it here.

If sites/live/ is in your code on GitHub, we will check it out and you can execute this script via your config file. Whatever dependencies you need should likely come from the Dockerfile for the environment.

 version: 2
       - image: circleci/ruby:2.4.1
       - checkout
       - run: ./sites/live/

Ah, sorry if I wasn’t clear. I can’t install third party software on the server due to hosting setup. So if Circle CI requires an agent to be installed on the server, then I probably can’t use it. If it can run on a different server and ssh in to run commands, then that WILL work.

Yep, all Linux-based providers can do this. Just issue an SSH command in your CircleCI job, ensure the private key is available to the SSH command, and you can run unattended upgrades easily.

I have an example of remote SSH commands here.

Oy, cheers!

1 Like