Deployment to private servers


#1

How I can deploy my code to private servers?


#2

It depends on how you want to do it and where you servers are. The simplest method is just to rsync files over.

I wrote a blog about how to do it with a Jekyll site here https://bitkumo.com/blog/continuously-deploying-with-jekyll-and-circleci/ but the jekyll part is not relevant, the procedure is the same for any scenario where you need to move files from CricleCI to your own servers.


#3

Thanks levlaz,

I need to deploy it to Windows Server 2012, how I can setup the circle file for Windows? I will need any dependency?


#4

We don’t really have a first class way of deploying to Windows. What is your current strategy for deploying to a windows Server?


#5

Currently I do it manually, I make a push with my commits from my local environment then I make a pull in Windows server
I’m looking for a way to do it automatically


#6

hi @levlaz

I am trying to follow your approach but the rsync commend does not really work. here is the error message

rsync -avz _site/ u73769297@hamdelesalvele.com/test
sending incremental file list
rsync: mkdir "/home/ubuntu/hamdelesalvele/deployuser@hamdelesalvele.com/test" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(674) [Receiver=3.1.0]

rsync -avz _site/ u73769297@hamdelesalvele.com/test returned exit code 11

Action failed: rsync -avz _site/ deployuser@hamdelesalvele.com/test

is it maybe because of the string /home/ubuntu/hamdelesalvele before user@server.com/directory

this is my circle.yml

deployment:
push_to_server:
branch: master
commands:
- rsync -avz _site/ u73769297@hamdelesalvele.com/test


#7

Try adding a colon (:) to your hostname like this:

deployment:
  push_to_server:
    branch: master
    commands:
      - rsync -avz _site/ u73769297@hamdelesalvele.com:/test

That will push the files to your server at the path /test/. If test is suppose to be relative, remove the slash before it in the rsync command. Then it would push to /home/u73769297/test.


#8

okay, thanks. this is seems to be fixed. now my server has a problem :frowning:


#9