[英]What's a good toolchain and deployment process for GIT and Deployment for a Windows user working on a LAMP Stack?
I run a custom PHP site on a Managed VPS (LAMP stack) and am the solo developer, but want to start using GIT so freelancers can contribute. 我在托管VPS(LAMP堆栈)上运行了一个自定义PHP网站,并且是一名单独开发人员,但想开始使用GIT,以便自由职业者可以做出贡献。 Currently I don't use GIT.
目前,我不使用GIT。
GIT GIT
For GIT, I wanted to use Visual Studio Online (VSO) since I've used it before but am open to suggestions if it's better for the suggested deployment process. 对于GIT,我想使用Visual Studio Online(VSO),因为我以前曾经使用过它,但是如果它对建议的部署过程更好,则可以公开提出建议。
Deployment 部署方式
I kept a "Dev" folder and a "Live" folder on the web server and simply did all of my dev in the Dev folder, tested there, then ran rsync to push it to the Live folder. 我在Web服务器上保留了一个“ Dev”文件夹和一个“ Live”文件夹,然后将所有开发人员都放在了Dev文件夹中,在那进行了测试,然后运行rsync将其推送到Live文件夹。 I couldn't easily run it locally since it has things like Linux symlinks, and I work on a Windows computer.
我无法在本地轻松运行它,因为它具有Linux符号链接之类的东西,并且我在Windows计算机上工作。
The Goal 目标
I want to start adding GIT to this process, integrate that into a decent build process, and still use a Windows IDE for development. 我想开始向该过程添加GIT,将其集成到一个不错的构建过程中,并且仍然使用Windows IDE进行开发。 Though maybe I should install a Linux VM on my Windows machine so I can start running the site directly from pulling the latest version from GIT?
虽然也许我应该在Windows计算机上安装Linux VM,以便可以直接从GIT中获取最新版本来开始运行站点?
I need a setup that would be easy for other developers to join on as I find freelancers to help out. 我需要一个易于让其他开发人员加入的设置,因为我找到了自由职业者来提供帮助。
Suggestions? 有什么建议吗?
here's what I do for 这就是我要做的
For deployment, I follow a very-simple git-flow technique ( http://nvie.com/posts/a-successful-git-branching-model/#the-main-branches ) with 2 branches: 对于部署,我遵循一个非常简单的git-flow技术( http://nvie.com/posts/a-successful-git-branching-model/#the-main-branches ),其中有两个分支:
master
for prod master
dev
for new features dev
新功能 You always develop new features on dev
branch, so dev
is always ahead of master in term of functionnalities. 您总是在
dev
分支上开发新功能,因此dev
在功能方面始终领先于大师。
When you want to deploy, you SSH on your server, you git pull dev
branch, and if everything works fine, you git merge
with master. 当您要部署时,您在服务器上使用SSH,您可以
git pull dev
分支,如果一切正常,您可以git merge
与master git merge
。
You can always switch on the prod server between prod and dev version with git branch master
and git branch dev
. 您始终可以使用
git branch master
和git branch dev
在prod和dev版本之间切换prod服务器。 No need of 2 folders, git handles this ! 不需要2个文件夹,git可以处理!
If you have a bug on prod environment, you can switch branch to master on your local computer and fix the bug. 如果您在产品环境中存在错误,则可以将分支切换到本地计算机上的master并修复该错误。 Then you upload it via ssh.
然后通过ssh上传。
I personally use docker, it creates a single VM which you can customize to match your prod environment (linux version, apache version, php version and my sql version). 我个人使用docker,它创建了一个VM,您可以对其进行自定义以匹配您的产品环境(Linux版本,apache版本,php版本和我的sql版本)。 You create 1 docker image, and then every collaborator can download this image and run it on his computer.
您创建1个docker映像,然后每个协作者都可以下载此映像并在其计算机上运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.