部署策略,PHP + SVN
我只是想讨论我们的部署策略并找出其中的差异。过程是这样的
->特定版本的开发完成
->所有开发人员将他们的文件提交到主干
->使用 TOAD 比较数据库模式并迁移更改
->在SVN上创建一个新分支
->使用 SVN 导出(删除 .svn 文件夹等)
->缩小 JS、CSS
->上传到临时服务器
->执行测试循环
->修复分支上的错误并验证它们
->重新缩小 JS、CSS [如果需要]
->上传到生产服务器
->当我说上传时,意思是通过 SSH 将文件上传到 /var/www/html 文件夹
->首先上传js、css、图片
->然后上传php文件
->上传期间排除用户上传的图片等目录
->执行测试循环
->修复错误并再次上传(可能需要重新缩小 - 几个文件)
->验证错误
->验证完成
->将分支提交到 svn
->将更改合并回主干
-> commit trunk [在这个部署周期中,没有人向 trunk 提交任何文件]
这个过程非常复杂,需要大量的关注。
关于如何改进它有什么建议吗?
i just wanna discuss our deployment strategy and find discrepancies in it. the process goes like this
-> Development finishes for a particular release
-> All developers commit their files to trunk
-> Compare database schemas using TOAD and migrate the changes
-> Create a new branch on SVN
-> Export using SVN (to remove .svn folder,etc)
-> minify the JS, CSS
-> upload to staging server
-> perform test cycle
-> fix bugs on the branch and verify them
-> re-minify the JS, CSS [if required]
-> upload to production server
-> when i say upload, it means uploading files through SSH to
/var/www/html folder
-> first upload js, css, images
-> then upload php files
-> during upload exclude directories like user uploaded pictures, etc.
-> perform test cycle
-> fix bugs and upload again (may need re-minify - few files)
-> verify bugs
-> verification completes
-> commit branch to svn
-> merge changes back to the trunk
-> commit trunk [during this deployment cycle, no one commits any files to the trunk]
the process is really complicated and requires lots of attention.
any suggestions on how we can improve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用了以下部署路径。它消除了您将文件重新上传到不同目录的许多需要。初始设置后,您需要做的最复杂的工作是每个测试位置中的“svn update”命令。
此设置假设您使用配置文件来指向资产、图像和 css 等目录。
所有项目都有一个配置文件,允许设置开发数据库、共享图像等的路径。config.dist.php 效果很好命名模式。每次签出都会将 config.dist.php 复制到 config.php。这允许许多配置而不会发生 SVN 冲突。
每个配置文件通常都有一些代码,例如
生产和开发服务器上的所有测试版本只能通过受限制的 ip 访问,并放在 .htaccess 文件后面。 Apache 配置为不提供 .svn 目录服务。
I used the following deployment path. It removes many of your needs to re-upload files to different directories. After initial setup, the most complicated work you will have to do is "svn update" commands in each of your test locations.
This setup assumes you use config files for pointing to directories like assets, images, and css.
All projects have a config file, that allows one to set paths to development databases, shared images, etc. config.dist.php works well as a naming schema. Each checkout then copies config.dist.php to config.php. This allows for many configs without SVN collisions.
Each config file typically has some code such as
All test versions on production and dev server are only accessable by restricted ips, as well as put behind a .htaccess file. Apache is configured to not serve .svn directories.
如果您正在使用单元测试(例如 Selenium),您可以使用构建工具来编写所有这些脚本,
如果没有,我只需编写以下步骤的脚本:
并
因为您已经在分支和合并,所以您应该保持主干始终是具有最新功能的稳定版本。
最后,标记您的版本
if you're using unit testing (e.g. Selenium) you can use a build tool to script all of this
if not, i would just script the following steps:
and
since you're already branching and merging, you should keep your trunk should always be a stable build with the latest features.
finally, TAG your releases