S
S
shell_execute2015-12-19 18:07:52
PHP
shell_execute, 2015-12-19 18:07:52

How to auto-deploy a PHP application?

Good day!
I would like to ask: how to organize an automatic deployment of a PHP application (with subsequent deployment of the database)?
The project is stored in a GIT repository (Gitlab CE).
I would like each branch to have its own subdomain and its own database, followed by migrations. Is it possible to organize this?
PS used to develop CakePHP 3, nginx web server.

Answer the question

In order to leave comments, you need to log in

10 answer(s)
V
Vladimir Luchaninov, 2015-12-24
@shell_execute

You need to try Docker.
Ideology:
- a Dockerfile is being made, which describes how to deploy the project from scratch and what to do every time the container starts (for example, clear the cache and apply migrations). There are only a couple of commands you need to know - ADD (add files), RUN (run a command), CMD / ENTRYPOINT (the main container application)
- Automatic build is configured on hub.docker.com, which can kick the server via a web hook, that it's time to pick up a new one image. You can do the same with Jenkins or even your own script
- when the server is told that a new image has appeared, it downloads it, stops the current container and quickly starts a new one. Simple - a couple of seconds. If it takes a long time, you can start a new container, but not delete the old one, put nginx or another balancer in front of them and switch to a new container in it, and then delete the old one.

K
Kirill Mokevnin, 2015-12-19
@toxicmt

Ansible is used to automate the deployment of projects in any language. It's a configuration management system that's great for deployments too. www.ansible.com The web is full of example articles and code github, for example:
https://www.digitalocean.com/community/tutorials/h...
https://github.com/ansistrano/deploy

A
Alexey Skobkin, 2015-12-19
@skobkin

For example, Jenkins + Capistrano (or Rocketeer). Combinations - mass.
By the way, the latest versions of Gitlab should have CI support.

A
Alexey, 2015-12-21
@akeinhell

As an option, you can look at an interesting tool - deployer.org

D
Dimonchik, 2015-12-19
@dimonchik2013

https://www.phptesting.org/

M
Max Kamashev, 2015-12-24
@ukko

.gitlab-ci.yml + deployer.org (or any other deployer: capistrano, ansible, etc..)

R
Roman Bulgakov, 2015-12-25
@Deroy

there is also a good tool magephp.com
, unlike Deployer, it works more stably (compared with version 2 - now if I'm not mistaken there is version 3 - I haven't looked at it.)
and unlike the mentioned Rocketeer - much more thoughtful and simple architecture - write custom processes deployment under it is many times easier than under Rocketeer.

N
newpy, 2015-12-24
@newpy

TeamCity by JetBrains
https://www.jetbrains.com/teamcity/

B
biperch, 2016-05-26
@biperch

I use shipitjs to deploy my projects
shipitjs

A
abubekovdd, 2019-03-14
@abubekovdd

Here is an excellent article on deploying from GitLab https://coderun.ru/blog/deplojj-php-sajjta-iz-gitl...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question