远程Symfony2 + Netbeans工作流程(feat。git) [英] Remote Symfony2 + Netbeans workflow (feat. git)

查看:147
本文介绍了远程Symfony2 + Netbeans工作流程(feat。git)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人遇到过这个问题,并且能够帮助



所以问题是这样的:有两个开发人员,他们每个人需要一个网站的2个版本(开发+生产)。由于操作系统非常不同,三重配置困难和管理限制,无法在本地运行项目。但是,在远程运行它们时存在一系列问题:如何在Netbeans中运行Symfony2 CLI命令(因为这些命令需要访问db) ?

  • 如何区分生产/开发?我允许外部访问2个IP地址的数据库,但只有一个 parameters.ini 文件。一旦它用于连接到本地主机(当通过http运行时),其次它用于通过远程主机进行连接(当CLI命令在netbeans中运行时)


  • $
    $ b

    • 开发者#1:Kubuntu 12.04 x64 3.2.0-b $ b

      更多信息您可能会问,所以这里是: 25-generic NB@7.1.2

    • Dev#2:Windows 7 x64 NB@7.1.2

    • 服务器:Ubuntu Server 12.04 x64
    • li>
    • SQL:PostgreSQL
    • webserver:Apache2



    工作流现在看起来(或者至少应该看起来像这样):


    1. 开发#1在本地执行某些操作,但在运行时更改正在移动到服务器,以便他可以检查它是如何进行 beta1.sitename.com


    2. 每次更改都会在git中提交给用户分支。在测试更改后,将baing合并到master,测试并拉到 sitename.com ,然后再次测试。

    3. 在此循环之后重复:)


    4. PS。有效的答案也是一个暗示,在这种情况下工作流应该如何。我已经尝试过使用post-* git控制柄,并且它也不能很好地工作......

    我强烈建议尝试解决开发机器问题。有,可与厨师或木偶(或专门的虚拟基础机器)一起使用,以移动开发环境进入在开发人员pc上执行的虚拟机。这也可以解决很多关于远程服务器的问题。



    如果不能这样做,这里有一些想法:

    < Netbeans命令无法工作。让开发人员ssh进入机器并执行他们的命令。



    我没有遇到开发/生产环境问题。他们应该至少在每个开发人员的配置/缓存/日志不同的虚拟主机上,以便配置可以正确设置。参数.ini不应该在你的git仓库中(你可以通过创建一个parameters.ini.dist并忽略parameters.ini文件来处理),这样你就可以拥有不同的参数。
    另一个有趣的事情(在2012年巴黎symfony上展示)是,你可以在你的apache虚拟主机中执行SET_ENV SMFONY_ PARAMETER _NAME,然后在配置文件中使用%parameter.name%两个不足)。这可能对您的案例有用。



    实际上,我不知道哪种工作流可以处理具有不同配置等的一台机器上的多个开发人员。这只是一团糟,你要么用复杂的脚本来解决你的问题,这些脚本每次发生时都会运行,或者找到一个更好的解决方案,比如虚拟机或者服务器上不同目录的不同虚拟主机。


    I'm hoping someone have encountered this problem before and will be able to help

    So, the problem goes like this: There's 2 developers, each one of them needs 2 versions of a website (development + production). Due to very different operating systems, triple configuration difficulities and administration restrictions on them it's impossible to run projects locally. But there's a bunch of problems while running them remotely:

    • How to run Symfony2 CLI commands in Netbeans (since those commands need access to db)?
    • How to differentiate between production/development? I have allowed external access to db for 2 IP addresses, but theres only one parameters.ini file. And once it's used to connect to localhost (when run by http), and second it's used to connect via remote host (when CLI command is run in netbeans)

    More info you may ask, so here it goes:

    • Dev #1: Kubuntu 12.04 x64 3.2.0-25-generic NB@7.1.2
    • Dev #2: Windows 7 x64 NB@7.1.2
    • Server: Ubuntu Server 12.04 x64
    • SQL: PostgreSQL
    • webserver: Apache2

    Our workflow now looks (or at least should look) something like this:

    1. Dev #1 does something locally, but on run changes are being moved to the server so he can check how it went on beta1.sitename.com.
    2. Each change is commited to user branch in git when suitable.
    3. After testing changes are baing merged to master, tested, pulled to a sitename.com, and then tested again.
    4. After this the cycle repeats :)

    PS. Valid answer would also be a hint how proper workflow in that kind of situation should be. I've tried already with post-* git handles, and it didn't work really well either...

    解决方案

    First of all I would highly recommend trying to solve the development machine issue. There is vagrant which can be used together with chef or puppet (or a specialiced virtual base machine) to move the development environment into a virtual machine executed on the developers pc. This would also solve many issues regarding the remote server.

    If this cannot be done, here are some thoughts:

    Netbeans commands won't work remotly. Have your developers ssh into the machine and execute their commands their.

    I don't get your development/production environment problem. Their should a at least on virtual host with different config/cache/logs for each developer so the configs can be set correctly. The parameters.ini should not be in your git repository (You can handle this by creating a parameters.ini.dist and ignoring the parameters.ini file) so you can have different parameters. Another interesting thing (presented on the symfony live 2012 Paris) is that you can do SET_ENV SMFONY_PARAMETER_NAME inside your apache vhost and then use %parameter.name% inside your config files (mind the two underscorse). This could be usefull in your case.

    There really is no workflow I know of which could handle multiple developers on one machine with different configs and the like. It's just a mess and you either solve your problems with complex scripts which are run everytime something happens or by finding a better solution like virtual machines or different vhosts with different directories on your servers.

    这篇关于远程Symfony2 + Netbeans工作流程(feat。git)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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