Git thread with github deployment

I participate in a team of 4 other developers, and we study GIT and use the gitflow and github model as a central repo. So far, we have created a central repository on github, and we can create functions, push them to the central repo and push them from there to change each other.

All developers work on their local machine, but we have 3 server installations - development, production and production.

Development is where everyone can view each other's changes, and as soon as we are happy, we will move on to staging. It is here that testing will be carried out so that everything is in order before we finally make the site live in production.

The site is now complete, and we cloned the repository on the development server and pulled out all the website files so that we can see all the changes there. Nevertheless, we are now not sure that we should deploy it at the stage of setting and, finally, to production.

  • Do we first create a release branch and push the central repo?
  • Are we cloning a central repo on an intermediate and production server?
  • If so, are we pulling it out of the central repo or should we ever use GIT on a production server? I read about using rsync as well as hooks ?!

If someone can explain the next steps or point me somewhere that explains this, it will be really helpful.

thanks

+4
source share
1 answer

I would have one person who is responsible for deploying to different servers, especially for staging and production. Thus, when creating the release branch, this branch will be deployed to the intermediate server. When the release department is complete, you deploy the main branch to the production server.

You can clone the repo for production and production, just make sure that the .git directory has the correct protection (.htaccess is your friend :)) so that no developers can access this directory.

I would use git pull on a production server. I also read about rsync and hooks, but just git works fine for me.

Now sometimes, when I work for a client that does not allow git on the server, and I use ftp. There is a Pyhton program on github called git-ftp , which I adapted a bit to host git-flow. I did not put this version on github, maybe it should.

According to the first comment
The person performing the production and production releases will perform the following steps on his local machine:

git flow release start -F 1.0 

do some work like update version number Post it to github

 git flow release publish 1.0 

On the staging server:

 git pull origin release/1.0 

After the end of the period of setting up the local machine

 git flow release finish 1.0 

On a production server

 git pull origin master 
+4
source

Source: https://habr.com/ru/post/1446467/


All Articles