您使用哪些工具/语言进行PHP Web应用程序部署?

时间:2022-09-02 09:06:17

For my web application running on LAMP, I need to be able to deploy database migrations and code changes on multiple servers and be able to test deployment afterwards, all of this automatically done by scripts.

对于在LAMP上运行的Web应用程序,我需要能够在多个服务器上部署数据库迁移和代码更改,并能够在之后测试部署,所有这些都由脚本自动完成。

Currently I'm torn between using directly my build tool (Phing) with some special deployment/test tasks, or shell scripts, or a scripting language like Ruby or Python.

目前,我直接使用我的构建工具(Phing)和一些特殊的部署/测试任务,或者shell脚本,或者像Ruby或Python这样的脚本语言。

The problem is that I feel that a build tool should be used to build, not to deploy. I also feel that shell scripts are hard to maintain and not very readable.

问题是我觉得应该使用构建工具来构建,而不是部署。我也觉得shell脚本难以维护且不易阅读。

Do you have any good advice on this subject ?

你对这个问题有什么好的建议吗?

6 个解决方案

#1


4  

For PHP projects, Phing is the way to go. Deployment is definitely one of its intended usage, considering that in PHP there isn't any "real" build process - as scripts are not compiled.

对于PHP项目,Phing是要走的路。部署绝对是其预期用途之一,考虑到在PHP中没有任何“真正的”构建过程 - 因为脚本没有编译。

From the official site:

来自官方网站:

If you find yourself writing custom scripts to handle the packaging, deploying, or testing of your applications, then we suggest looking at the Phing framework.

如果您发现自己编写自定义脚本来处理应用程序的打包,部署或测试,那么我们建议您查看Phing框架。

Phing can do everything shell/python/ruby scripts can do, and can be extended in PHP which is its major draw for PHP developers. Why would you want to use ruby/python if you are a PHP developer?

Phing可以完成shell / python / ruby​​脚本可以做的所有事情,并且可以在PHP中进行扩展,这是PHP开发人员的主要绘图。如果您是PHP开发人员,为什么要使用ruby / python?

#2


3  

Rasmus Lerdorf (creator of PHP) released a deployment tool called WePloy.

Rasmus Lerdorf(PHP的创建者)发布了一个名为WePloy的部署工具。

#3


3  

A lot of people here on * seem to really like Capistrano.

*上的很多人似乎都非常喜欢Capistrano。

#4


2  

To deploy web applications, PHP or other, in some click, you can use fredistrano.

要部署Web应用程序,PHP或其他,在某些单击中,您可以使用fredistrano。

#5


0  

What have I used?

我用过什么?

  • svn post-commit hook
  • svn post-commit hook

  • shell script to rsync
  • shell脚本到rsync

  • perl cgi script to svn switch across systems
  • perl cgi脚本到svn跨系统切换

It doesn't seem like any of these would be acceptable for you though, given your statement "I also feel that shell scripts are hard to maintain and not very readable."

但是,鉴于您的声明“我也觉得shell脚本难以维护且不易阅读”,看起来似乎没有任何一个可以接受。

#6


0  

Personal script which uses Svn export + rsync

使用Svn export + rsync的个人脚本

#1


4  

For PHP projects, Phing is the way to go. Deployment is definitely one of its intended usage, considering that in PHP there isn't any "real" build process - as scripts are not compiled.

对于PHP项目,Phing是要走的路。部署绝对是其预期用途之一,考虑到在PHP中没有任何“真正的”构建过程 - 因为脚本没有编译。

From the official site:

来自官方网站:

If you find yourself writing custom scripts to handle the packaging, deploying, or testing of your applications, then we suggest looking at the Phing framework.

如果您发现自己编写自定义脚本来处理应用程序的打包,部署或测试,那么我们建议您查看Phing框架。

Phing can do everything shell/python/ruby scripts can do, and can be extended in PHP which is its major draw for PHP developers. Why would you want to use ruby/python if you are a PHP developer?

Phing可以完成shell / python / ruby​​脚本可以做的所有事情,并且可以在PHP中进行扩展,这是PHP开发人员的主要绘图。如果您是PHP开发人员,为什么要使用ruby / python?

#2


3  

Rasmus Lerdorf (creator of PHP) released a deployment tool called WePloy.

Rasmus Lerdorf(PHP的创建者)发布了一个名为WePloy的部署工具。

#3


3  

A lot of people here on * seem to really like Capistrano.

*上的很多人似乎都非常喜欢Capistrano。

#4


2  

To deploy web applications, PHP or other, in some click, you can use fredistrano.

要部署Web应用程序,PHP或其他,在某些单击中,您可以使用fredistrano。

#5


0  

What have I used?

我用过什么?

  • svn post-commit hook
  • svn post-commit hook

  • shell script to rsync
  • shell脚本到rsync

  • perl cgi script to svn switch across systems
  • perl cgi脚本到svn跨系统切换

It doesn't seem like any of these would be acceptable for you though, given your statement "I also feel that shell scripts are hard to maintain and not very readable."

但是,鉴于您的声明“我也觉得shell脚本难以维护且不易阅读”,看起来似乎没有任何一个可以接受。

#6


0  

Personal script which uses Svn export + rsync

使用Svn export + rsync的个人脚本