Webhook實踐 —— PHP自動部署
Webhook實踐 —— PHP自動部署
1、部署Gogs
參考博客:使用 Gogs 搭建自己的 Git 服務器
2、添加git的ssh公鑰
因為是用git用戶部署的Gogs,接下來在服務器上配置用git賬號配置ssh公鑰
首先在主機上生成秘鑰:
[[email protected] ~]$ ssh-keygen -t dsa -P "" -f ~/.ssh/id_dsa Generating public/private dsa key pair. Created directory ‘/home/xiaozhenkai/.ssh‘. Your identification has been saved in /home/xiaozhenkai/.ssh/id_dsa. Your public key has been saved in /home/xiaozhenkai/.ssh/id_dsa.pub. The key fingerprint is: ec:ca:56:5d:75:5a:3a:71:e2:d7:a6:1e:1e:4d:ba:eb [email protected]
復制主機密鑰
[[email protected] .ssh]$ cat ~/.ssh/id_dsa.pub ssh-dss AAAAB3NzaC1kc3MAAACBAPc/kOGP7pIw2hwBzredF9oMnh/UQUTk9PfoWKw796/eroLUZE8ON+ibzKhgjT+/cHrqbesgku1qJ4bvSdaoJXLOgfKpZmbSWeo3ainWQx44dNxgO8ITG2Ss6oKCsUj8OBiObycP4ki6GBDLsnXu4b/bKbVE0tRbejeVpeRFP40XAAAAFQDCt3x9tEZE15jwXLvspUiur/mg9wAAAIEA0DA28/QDpnRvJ5x2t3JUBb2EkGa969kwdUHqv618S5doIKWvQhUrWLXq1/PJaZeAGGuNfMJSXtSrXBtdnES7PsoSnTfKBczTvnpyD5zD+oMr6znsPHXtkUdUPK/Zr6K2gRISTd+otNQxSuX2H7WaFwoRjyTC0ichcKpuD1acBrwAAACAY8B/Zcuo0GxAyd/WMsoUSzSUxa4WFVyFkFm9qVEXUDv91BFqhbNDDpmkxgDqH2GOCgHD4CjX1PebMBNKYSfT0LaTEKIYVn6tnvL+yoEbqt77HvID/xDxf8WIZtZ0L6BL1K8xc7tiMHbkW9dNgiFyUAnHWW+OZfU2x9t51PvsLNA= [email protected]