Reputation: 485
I am in a team of 4 other developers and we are learning GIT and using the gitflow model and github as the central repo. So far we have created the central repository on github and we can create features, push them to the central repo and pull from there to get each others changes.
All developers work on their local machine, however we have 3 servers setup - development, staging and production.
Development is where everyone can view each others changes and once we are happy we will transfer to staging. This is where testing will take place to ensure everything is ok before we finally make the website live on production.
The website is currently finished and we have cloned the repository on the development server and pulled all the website files so we can see all changes on there. However, we're now unsure we should deploy to staging and finally to production.
If someone can please explain the next steps or point me to somewhere which explains it that would be really helpful.
Thanks
Upvotes: 4
Views: 1401
Reputation: 14468
I would have one person who is in charge of deploying to the different servers, especially staging and production. That way when you create a release branch, this branch would be deployed on the staging server. When the release branch is finished you deploy the master branch to the production server.
You can clone the repo to staging and production, just make sure the .git directory has proper security (.htaccess is your friend :)), so that non-developers can't access that directory.
I would use git pull on the production server. I've read about rsync and hooks as well, but just git works just fine for me.
Now sometimes when I work for a client that doesn't don't allow git on the server and I use ftp. There is a Pyhton program on github called git-ftp which I adapted a little bit to accommodate git-flow. I haven't put that version on github, maybe I should.
As a follow up to the first comment
The person who does the staging and production releases would do the following steps on his/her local machine:
git flow release start -F 1.0
do some work, like update version number Publish it to github
git flow release publish 1.0
On the staging server:
git pull origin release/1.0
After the staging period is over, on the local machine
git flow release finish 1.0
On the production server
git pull origin master
Upvotes: 4