简体   繁体   English

Git +共享托管工作流程,想法?

[英]Git + Shared hosting workflow, ideas?

I've been mulling over this for a few weeks in preparation but kind of stuck in a holding pattern. 我已经为准备工作进行了几周的思考,但有点陷入停滞状态。

Here's what I'm working with: Windows Development environment (I know I know. Price is right losing horn.) Develop off of working directories on a shared drive Upload changes to FTP test site, send for QA Once QA is complete, copy files to production-ready directory on shared drive Upload to Live Site Both Test + Live environments are on separate, shared hosts with no shell access. 我正在使用的工具是:Windows开发环境(我知道我知道。价格不对劲。)在共享驱动器上开发工作目录,将更改上传到FTP测试站点,进行质量检查,一旦完成质量检查,复制文件到共享驱动器上生产就绪的目录上载到实时站点Test + Live环境都位于单独的共享主机上,没有外壳访问权限。

That means I am working with 4 (yes, four) separate directories. 这意味着我正在使用4个(是的,四个)单独的目录。

I have a new virtualbox running Ubuntu in a LAMP setup and have copied my production directory to it in hopes of creating a git repository that I can commit to. 我有一个在LAMP设置中运行Ubuntu的新virtualbox,并已将生产目录复制到该虚拟机中,希望创建一个我可以提交的git存储库。 From there, I'd like to be able to commit to a series of feature branches sitting on top of a development branch. 从那里,我希望能够致力于一系列位于开发分支之上的功能分支。 When ready for QA, I'd need to sync my development branch to the test server. 准备进行质量检查时,我需要将开发分支同步到测试服务器。 When QA is complete, I'd need to merge development into production branch and then sync the production branch ti the live server. 质量检查完成后,我需要将开发合并到生产分支中,然后将生产分支与实时服务器同步。

Right now, I just have a working production directory on the virtualbox. 现在,我在virtualbox上只有一个工作目录。 I need to initialize a git repository and be able to check it out to my local machine, committing/pushing changes as necessary. 我需要初始化一个git存储库,并能够将其检出到本地计算机,并根据需要提交/推送更改。 I just don't know what the best way to go about merging/syncing/uploading would be, given the shared host situation. 考虑到共享主机的情况,我只是不知道进行合并/同步/上载的最佳方法是什么。

Any ideas would be greatly appreciated. 任何想法将不胜感激。 I'm starting to just confuse myself even thinking about it. 我什至开始思考就把自己弄糊涂了。

Check out this link for a very useful git branching model: 查看此链接以获得非常有用的git分支模型:

http://nvie.com/posts/a-successful-git-branching-model/ http://nvie.com/posts/a-successful-git-branching-model/

In your case, the "release" branch would be the QA branch and your master branch would be the branch that would be pushed live. 在您的情况下,“发布”分支将是QA分支,而您的主分支将是实时发布的分支。

Once you implement that, you can set up a git hook to automatically push the contents of the directory to the live servers using ftp, ssh or any other protocol you choose. 一旦实现了这一点,就可以设置一个git挂钩,以使用ftp,ssh或您选择的任何其他协议将目录的内容自动推送到实时服务器。

Use something like team city to make artifacts. 使用团队城市之类的东西来制作文物。 Then script deployment. 然后脚本部署。 It would be an easier story if you were doing something in ruby or other interpreted language as a checkout of a branch would be your deployment. 如果您用红宝石或其他解释语言来做某事,这将是一个简单的故事,因为将分支的签出作为您的部署。

For branch management, check out git flow. 对于分支机构管理,请检查git flow。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM