开发流程,部署,GitHub [英] Development process, deployment, GitHub

查看:144
本文介绍了开发流程,部署,GitHub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们有3/4个令人讨厌的开发人员在我们的代码库中进行任何操作。 p>

我们已经开始使用GIT,并且想法是,工作不仅仅是一个实时修复,而是分支主分支。



每个人都有自己的开发环境在服务器上,我们有一个分期环境,应该始终是主分支的副本。



开发人员在本地开发,然后并入主分支,然后将其更改推送到分段服务器(我想设置这样的东西)。



如果全部被批准,那么这个变化应该是现实的。我想以某种方式自动化,不知道究竟如何。我们使用的是GitHub,所以我确定在那里有自动化的部署脚本。



我们只有一个实时服务器,但是如果只更改文件在主分支上可以部署到实时服务器。



任何想法如何做?



是这个方法声音?



任何其他评论/警告?



需要负载平衡器来做这样的事情?

解决方案

我的公司最靠近这个博客



我们为生产创建了 master 分支。



我们做的是



开发人员叉他们的功能/错误从

  git checkout -b功能/功能A 
git结帐-b bug / B

以这种方式,我们将在发布的行中获得新的代码。在分段服务器中,我们使用测试分支。所以,当任何功能想要测试时,它将合并到该分支。



在分段服务器中,我们使用

  git checkout testing 
git pull

发布分支处理热修复,每个热修复将合并到该分支之前合并到主。这个想法是,发布分支将在合并之前打包一些提交,以掌握哪个问题,如果问题出现,它只是使用像

  git这样的命令重置 -  hard HEAD ^ 

临时。



让我们看看我的全部工作步骤

  git checkout master#转到Master 
git checkout -b功能/新#新分支

电子邮件来自老板修复关键错误



  git stash 
git checkout master
git checkout -b hotfix / a

做事情

  git commit 
git checkout release
git merge hotfix / a
git checkout master
git merge release#如果你想打包所有准备生产

在生产中

  git tag -d以前的
git标签以前的
git拉

糟糕!不工作

  git checkout previous 

新提交合并

  git checkout master 
git pull

继续我的工作

  git结帐功能/新
git隐藏弹出#Restore工作空间
git commit
git结帐测试#准备混合测试
git合并功能/新

准备发布功能

  git checkout release 
git merge feature / New

是因为测试分支中的一切事情准备好部署。所以,当将所有就绪功能合并到发布分支时,现在可以进行最终测试。



/ p>

  git checkout testing 
git merge master
git checkout release
git merge master

自动脚本



我想你可以在提交代码后查看 .git / hooks / post-commit.sample 来连接一些脚本?无论如何,我从来没有使用它。


I am trying to bed down a development process for our team.

We have 3/4 disperate developers working on our code base at any one time.

We have started using GIT and the idea is that is piece of work is more than a live fix, then they fork the master branch.

Everyone has their own dev environment on the server, and we have one staging environment which should at all times be a copy of the master branch.

Developers develop on their local, then merge back into the master branch, which should then push their changes to the staging server (I want to set up something like this).

If all is approved, then the changes should be copied live. I want to automate this somehow, not sure how exactly. We are using GitHub, so I'm sure there are automated deploy scripts out there.

We only have 1 live server though so it'd be nice if only changed files on the master branch could be deployed to the live server.

Any ideas how to do this?

Is this approach sound?

Any other comments/ warnings?

Is a load balancer necesary to do things like this?

解决方案

My company following nearest by this blog.

We create the master branch for production. My case is for web development.

Step we do is

Developer fork their feature/bug from master

git checkout -b feature/featureA
git checkout -b bug/B

With this way, we will got the fresh code with already in the released line. In staging server, we use testing branch. So, when any feature want to going test, it will merge to that branch

In staging server we use

git checkout testing
git pull

There are release branch handling the hot fix, every hot fix will merge to this branch before merge to master. The idea is that release branch will packing some commits before merge to master which if the problem occurs, it just use command like

git reset --hard HEAD^

for temporary.

Let see my full working Step

git checkout master # Go to Master
git checkout -b feature/New  # New branch

Email come from boss to fix critical bug

git stash 
git checkout master
git checkout -b hotfix/a

do things

git commit
git checkout release
git merge hotfix/a
git checkout master
git merge release # In case that you want to pack all ready to production

In production

git tag -d previous
git tag previous
git pull

Oops! not working

git checkout previous

New commit merged

git checkout master
git pull

Continue my job

git checkout feature/New
git stash pop #Restore workspace
git commit
git checkout testing # ready to mix a test
git merge feature/New

Ready to release the feature

git checkout release
git merge feature/New

This is because all things in testing branch ready to deploy. So, when merge all ready feature to release branch, now, you can make final test.

When everything now go production, we do

git checkout testing
git merge master
git checkout release
git merge master

Automate script

I think you may look into .git/hooks/post-commit.sample for hookup some script after you commit the code? anyway, I never use it.

这篇关于开发流程,部署,GitHub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆