0

I want to deploy a currently running website(php,python,ROR and what ever).
And my code is hosting in git.
I read about 'deploy your website changes using git

and stackoverflow answer

and it's useful. But it has a problem. It'll interrupt the production server.
Althought the time is short. But if our server is heavy load. It also interrupt the user.

So my question is how to deploy code to the production server without interrupting.
Assume several situation.

  1. Only one production server.
    Is it the only viable method is stop the production server and wait until the deployment is completed?

  2. More than two production servers.
    I know we can stop one production server and deploy to it, then deploy to the next server until complete.
    But is there any method to do this better?

All of the method should be auto. Thanks!

Community
  • 1
  • 1
Magic
  • 1,182
  • 2
  • 18
  • 28

2 Answers2

0

You can't deploy directly to the live production server without potentially interrupting some connection when it reloads. It would actually depend on the type of site. If its a server that is serving say, php pages, replacing the pages would allow the next client to pick them up. But if deployment means restarting processes then it would disrupt. Ultimately unless its static pages, you are going to conflict with something I am sure.

Maybe what you can do is have two production servers behind a proxy. Make one live. Deploy to the other one and switch the ip/host when deployment is complete and just start sending new traffic to the newly updated server. The original server is now not receiving traffic. You can deploy to that server the next time and switch the host back on the proxy. Then you always have a live server.

jdi
  • 90,542
  • 19
  • 167
  • 203
0

I found a tool that almost solve my problem.
It's developed by PHP author Rasmus Lerdorf which named WePloy.
But it can deploy PHP website only.

Magic
  • 1,182
  • 2
  • 18
  • 28