【发布时间】:2023-03-28 12:30:01
【问题描述】:
已编辑:(在看到卢克的回答后)
我正在寻找开发一个网站,所有工作都将远程完成(没有本地开发服务器)。原因是我的共享托管公司 a2hosting 有一个特定的配置(symfony、mysql、git),当我可以远程 ssh 和开发或通过 netbeans 远程编辑功能时,我不想花时间复制。
我的问题是如何使用 git 将我的网站分成三个区域:live、staging 和 dev。
这是我的初步想法:
public_html(实时站点和 git repo)
测试:用于视觉测试的站点镜像(完整的 git 存储库)
dev/ticket# : public_html 的 git 分支,用于功能和错误修复(完整的 git repo)
使用 git 进行版本控制:
初始设置:
cd public_html
git init
git add *
git commit -m ‘initial commit of the site’
cd ..
git clone public_html testing
mkdir dev
发展:
cd /dev
git clone ../testing ticket#
all work is done in ./dev/ticket#,
then visit www.domain.com/dev/ticket# to visually test
make granular commits as necessary until dev is done
git push origin master:ticket#
if the above fails:
merge latest testing state into current dev work: git merge origin/master
then try the push again
mark ticket# as ready for integration
集成部署流程:
cd ../../testing
git merge ticket# -m "integration test for ticket# --no-ff (check for conflicts )
run hudson tests
visit www.domain.com/testing for visual test
if all tests pass:
if this ticket marks the end of a big dev sprint:
make a snapshot with git tag
git push --tags origin
else
git push origin
cd ../public_html
git checkout -f (live site should have the latest dev from ticket#)
else:
revert the merge: git checkout master~1; git commit -m "reverting ticket#"
update ticket# that testing failed with the failure details
快照:
每个主要部署冲刺都应该有一个标准名称并进行跟踪。 方法:git标签 命名约定:待定
将网站恢复到以前的状态
如果出现问题,则恢复到以前的快照 并使用新票#在开发中调试问题。修复错误后,请关注 再次部署过程。
我的问题:
1-此工作流程是否有意义,如果没有,任何建议 2-我的还原方法是正确的还是有更好的方法来表示“还原到 x 提交之前”
感谢您花时间阅读这篇很长的帖子:)
【问题讨论】: