Git 使用 WAMP 在 Windows 2003 上自动部署

Git autodeploy on Windows 2003 with WAMP

我为一家公司工作,该公司出于某种原因使用带有 WAMP 的 Windows 2003 服务器作为其实时产品(请不要问我为什么)。目前我们必须将更新本地推送到 github,使用远程桌面连接手动连接到此生产服务器并拉取。

我们想使这个过程自动化。

我已经在全局范围内尝试了 github webhooks with no success -> Couldn't find a way to create SSH keys for the system account (NT AUTHORITY/SYSTEM), which is the one used by apache on that server solution. The project is currently cloned via HTTPS, so we could also try saving credentials,这样 git 在尝试通过 PHP 拉取时不会提示本地系统帐户输入密码,但这似乎是最糟糕的解决方案安全方面。

有什么想法吗?

-- 更新--

我们决定现在不担心安全隐患。然后我按照所有步骤为新的只读用户保存凭据,但没有成功。我可以在以下位置看到一个 .git-credentials 文件,其中包含正确的 user/pass/url:

C:\WINDOWS\system32\config\systemprofile

除了 pull、fetch 等之外的所有命令(通过浏览器)都有效

还有什么想法吗?

-- 更新 2 --

我现在已将 wampapache 服务更改为 运行 作为管理员帐户,它的 "root" 文件夹 (~) 中也存储了凭据。这是我可以通过 cmd push/pull 无需 user/pass 提示的同一个帐户。但是当我通过浏览器尝试时......没有运气。

我现在正式没主意了。

终于找到解决办法了!

只需编辑 git 配置文件,将 user:password 添加到 [远程 "origin"] 下的 url 参数即可完成工作。

url = https://user:pass@github.com/organization/project.git