S
S
Shahelm2014-04-06 17:41:56
PHP
Shahelm, 2014-04-06 17:41:56

Deploy to multiple php code servers?

Good afternoon everyone!
There are:
- 5 servers, new servers may be added in the future
- git
Necessary:
​​- update the code on servers without downtime in one command
- after deploy, perform n tasks (reset cache, generate proxy classes, etc.)
- be able to rollback to the previous version in one command
I looked in the direction of capistrano, everything seems to fit, the only thing I didn’t understand is whether it is possible to deploy to several servers and whether capistrano can roll back the git repository to the previous state.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Rpsl, 2014-04-06
@Shahelm

capistrano, fabric, phing, etc... All of them are essentially just a wrapper for executing commands on a remote machine. To deploy and rollback actions, you need to write an independent set of commands.
In most cases, the deployment scheme works like this:
A snapshot of the current repository is created.
Uploaded to a remote server in the /var/www/mysite/deploy_2015_01_01_00:00:01 folder
The web server itself looks at a symlink like /var/ww/mysite/current
If everything went well, then the symlink is transferred to the newly created folder.
The rollback process is the same, just the opposite, we look at what deployment folders are and transfer the symlink to the penultimate one.

D
DDanya, 2014-04-06
@DDanya

On several it is possible, but I don’t know how. And it can also roll back git. You need to climb into the docs.

S
Shahelm, 2014-04-06
@Shahelm

I understand how the scheme works, I'm interested in:
- can capistrano deploy to several servers
- can capistrano rollback git to the desired state with deploy:rollback
Preferably with links to the dock or something else.

S
Shahelm, 2014-04-06
@Shahelm

@Sander_Li
Git hooks are not suitable, we need to perform some tasks after deploy. Without completing these tasks, downtime will occur.
The capistrano functionality will suit me completely if it makes it possible to deploy to several servers.
I understand that he can do it, I'm just looking in the wrong place). And I can hook the git rollback to deploy:rollback, correct me if I'm wrong.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question