Answer the question
In order to leave comments, you need to log in
How to deploy a website to hosting correctly, quickly and conveniently?
I've always used FTP/SFTP file synchronization by pressing Ctrl+S in PhpStorm. Collecting the frontend - locally, through watchers. Tests are also local. But, as I already understood, this is not a labor method, but it is convenient.
I read on the net that you need to use CI / CD, which will download the latest version from the git, install dependencies, tests, upload to the server, unzip into a separate folder, tests, and eventually switch the webbrut symlink to this folder. But this method did not seem very convenient to me. How to make hot fixes then? Changing one letter in the code is a whole process. What to do with the database? What to do with uploaded files from users? Copy from previous version?
Answer the question
In order to leave comments, you need to log in
> But this method did not seem very convenient to me. How to make hot fixes then? Changing one letter in the code is a whole process.
In a good process, this is not a problem. If the change is critical, you simply deploy the old version (not rollback, but deploy the old one). Hot fixes are a way out of the problem, and its solution.
> I read on the net that you need to use CI / CD, which will download the latest version from the git, install dependencies, tests, upload to the server, unzip into a separate folder, tests, and eventually switch the webbrut symlink to this
folder all this history is already being done (and quite a long time ago) using docker. You can at least get to know it a bit here guides.hexlet.io/docker/.If docker is too early for you, then you can implement the process using Ansible and its special module docs.ansible.com/ansible/latest/deploy_helper_modu...
There you will also see the answer to the question "what to do with the state".
> What to do with a DB? What to do with uploaded files from users? Copy from previous version?
The state has nothing to do with the deployment, it must be shared. If you have files from users, then you might want to use aws s3. At least you need to know about it.
I recommend watching the webinar about stateless vs statefull at the same time to understand this topic a little: https://www.youtube.com/watch?v=WPCz_U7D8PI
When working alone:
1. For database migration/synchronization:
1.1. Times
1.2. Two
1.3. Three
2. For files:
2.1. Times
2.2. Two (with visual comparison of content before synchronization!)
--------------------------------------------------
When working in a team ( or without) - we connect through the version control system (VCS) from the IDE with which we are used to working:
PhpStorm VCS Help
Well, first of all, the folder structure. like
/app
/var
/public
/log
and not everything in www
user-generated content and static in general can be on non-executable subdomains.
I read on the net what you need
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question