【发布时间】:2019-05-28 09:41:25
【问题描述】:
背景
我正在处理 node.js + react 项目。
我在 github 上以私有模式管理我的项目。因为这不是开源的。
我将源代码移至 Cloud Computer(Ubuntu 16.04) 进行部署。 我不想每次发生一些变化都上传我的源代码,所以我决定使用 github 的 webhook 进行自动化部署。
这些是使用 github 的 webhook 设置自动部署的整个过程。
- github 的 webhook 设置
- node.js服务器设置只接收来自github的post数据
- 执行我为从 github(
git pull origin master) 拉取更新源代码而创建的 deploy.sh - 重启我的 node.js 生产服务器
那么,你的问题是什么?
在 numbber 3,命令行工具询问我 github 的用户名和密码,因为我的项目是私有的而不是公开的!。
我想这样做git pull origin master -username rpf5573 -password MyPassWord。
如何将我的用户名和密码作为参数传递?
请给我一些建议!。
【问题讨论】:
-
你试过ssh key吗?
-
@ThunderMind 不,我没有,我会检查一下!
标签: git