PHP Web 项目的版本控制

发布于 2024-07-04 16:58:15 字数 209 浏览 4 评论 0原文

我们有一个 PHP 项目,我们想要对其进行版本控制。 现在,我们三个人正在开发该项目的开发版本,该版本位于一个外部文件夹中,我们所有的 Eclipse IDE 都链接到该文件夹​​,因此没有版本控制。

版本控制的正确方法和最佳方法是什么?

我们已经设置了 SVN,但我们只需要找到一种签入和签出的好方法,以便我们可以在开发服务器上进行测试。 有任何想法吗?

We have a PHP project that we would like to version control. Right now there are three of us working on a development version of the project which resides in an external folder to which all of our Eclipse IDEs are linked, and thus no version control.

What is the right way and the best way to version control this?

We have an SVN set up, but we just need to find a good way to check in and out that allows us to test on the development server. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

待天淡蓝洁白时 2024-07-11 16:58:16

您可以用于构建的另一个工具是 TeamCity,它免费提供 20 种构建配置(足以满足大多数人的需要)小公司/项目。)这样您就可以运行测试并安排构建。

Another tool you can use for the builds is TeamCity which is free for 20 build configurations (enough for most small companies/projects.) This way you can run your tests as well as schedule builds.

£烟消云散 2024-07-11 16:58:15

Beanstalk 具有内置的提交后挂钩,用于部署到开发、登台和生产服务器。

Beanstalk has built-in post-commit hooks for deploying to development, staging, and production servers.

最丧也最甜 2024-07-11 16:58:15

使用 Subversion 进行 PHP 开发的一种方法是为一个或全部三个开发人员设置一个存储库,并使用此存储库,更多地作为同步工具,而不是真正的版本控制。

您可以,

  • 创建一个存储库

  • 添加项目的整个 PHP 文档结构

  • 签出此存储库的副本到您的开发服务器上的正确位置

  • 使用 svn 钩子,在提交时激活

这个钩子,每当团队中的任何人签入任何代码时,都会自动更新开发服务器的内容。

钩子位于:

svn_dir/repo_name/hooks/post-commit

可能看起来像:

/usr/bin/svn up /path_to/webroot --用户名 svn_user --密码 svn_pass

这会将开发服务器上的工作副本更新为最新签入。

One way to use subversion for PHP development is too setup a repository for one or all three developers, and use this repository, more as a syncing tool, than true version control.

You could,

  • Make a repo

  • Add your entire PHP document structure of your project

  • Checkout a copy of this repo into the correct spot on your dev server

  • Use an svn hook, that activates on commit

This hook, will automatically update the contents of the dev sever, whenever anybody on the team checks in any code.

Hook resides in:

svn_dir/repo_name/hooks/post-commit

And could look like:

/usr/bin/svn up /path_to/webroot --username svn_user --password svn_pass

That will update your working copy on the dev server to the latest check in.

凤舞天涯 2024-07-11 16:58:15

分布式的东西怎么样? 例如,您可以从 Mercurial 开始,尝试不同的工作流程,然后看看哪一个最适合您。

What about something distributed? You can start for example with Mercurial, try different workflows, and see which one fits you the best.

活雷疯 2024-07-11 16:58:15

你们每个人都可以在本地运行它,或者在您自己的开发服务器上运行它(甚至是具有不同端口的同一服务器......)。

Each of you could run it locally, or on your own dev server (or even the same one with a different port...).

烟沫凡尘 2024-07-11 16:58:15

一种可能的方法(可能有更好的方法):

你们每个人都应该有自己的项目签出版本。

在您的计算机上拥有服务器的本地副本并全天在那里进行测试。 然后在每天结束时(或任何时候),您将准备测试的所有内容合并在一起,然后将其签出到开发服务器上并进行测试。

One possible way (there are probably better ways):

Each of you should have your own checked out version of the project.

Have a local copy of the server on your computer and test it there throughout the day. Then at the end of each day (or whenever), you merge together whatever you are ready to test, and you check it out onto the dev server and test it.

嘿看小鸭子会跑 2024-07-11 16:58:15

我们的做法如下:

  • 每个开发人员都有一个虚拟机,其配置与我们的集成服务器类似
  • 集成服务器有用于主干、每个用户的空间以及用于分支的几个插槽
  • 生产服务器
  • 在提交时,挂钩位于 Subversion 中以发送电子邮件

在项目开始时,用户创建一个分支并在其个人虚拟机上检查它,并获取数据库的干净副本。 他们做自己的工作,边走边承诺。

一旦他们在自己的个人空间中完成了所有事情,他们就会登录到集成服务器并检查他们的分支,运行他们的测试等。当所有通过的分支都被合并到主干中。

重建主干,运行全套测试,如果一切顺利,它就会获得批准,在 SVN 中标记,并在晚上结束时升级到生产环境。

如果其他人在任何时候进行了提交,我们都会收到一封电子邮件,并且可以将这些更改合并到我们单独的分支中。

Here is what we do:

  • Each dev has a VM that is configured like our integration server
  • The integration server has space for Trunk, each user, and a few slots for branches
  • The production server
  • Hooks are in Subversion to e-mail when commits are made

At the beginning of a project, the user makes a branch and checks it out on their personal VM as well as grabs a clean copy of the database. They do their work, committing as they go.

Once they have finished everything in their own personal space they log into the integration server and check out their branch, run their tests, etc. When all that passes their branch is merged into Trunk.

Trunk is rebuilt, the full suite of tests are run, and if all is good it gets the big ol' stamp of approval, tagged in SVN, and promoted to Production at the end of the night.

If at any point a commit by someone else is made, we get an e-mail and can merge those changes into our individual branches.

夜司空 2024-07-11 16:58:15

我们遇到了类似的情况,这就是我们最终所做的:

  • 建立两个分支——发布和开发分支。
  • 对于开发分支,包括一个将存储库部署到开发服务器的提交后挂钩,以便您可以进行测试。
  • 准备就绪后,您可以将更改合并到发布分支中。 我还建议放置一个提交后挂钩以便在那里部署。

您还可以在每个团队成员的工作站上设置单独的开发服务器。 我发现它加快了速度,尽管您确实有更多的设置时间。

我们必须使用单个开发服务器,因为我们使用专有的 CMS 并遇到了许可问题。 所以我们的提交后挂钩是一个简单的 FTP 机器人。

We were in a similar situation, and here's what we ended up doing:

  • Set up two branches -- the release and development branch.
  • For the development branch, include a post-commit hook that deploys the repository to the dev server, so you can test.
  • Once you're ready, you merge your changes into the release branch. I'd also suggest putting in a post-commit hook for deployment there.

You can also set up individual development servers for each of the team members, on their workstations. I find that it speeds things up a bit, although you do have some more setup time.

We had to use a single development server, because we were using a proprietary CMS and ran into licensing issues. So our post-commit hook was a simple FTP bot.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文