Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在使用.cpanel.yml推入Github存储库后自动更新cpanel_Git_Github_Cpanel_Automatic Updates - Fatal编程技术网

在使用.cpanel.yml推入Github存储库后自动更新cpanel

在使用.cpanel.yml推入Github存储库后自动更新cpanel,git,github,cpanel,automatic-updates,Git,Github,Cpanel,Automatic Updates,8我正试图通过Github存储库更新我的cpanel 让我解释一下我的尝试: 步骤1:首先,我在Github中创建了一个私有存储库 步骤2:克隆本地计算机中的存储库 步骤3:添加了在GitHub存储库中推送的所有文件(成功上载了提交消息) 步骤4:在项目文件夹中创建.cpanel.yml。 .cpanel.yml代码如下 --- deployment: tasks: - export DEPLOYPATH=/home/cpanelUserName/public_html

8我正试图通过Github存储库更新我的cpanel

让我解释一下我的尝试:

步骤1:首先,我在Github中创建了一个私有存储库
步骤2:克隆本地计算机中的存储库
步骤3:添加了在GitHub存储库中推送的所有文件(成功上载了提交消息)
步骤4:在项目文件夹中创建.cpanel.yml。
.cpanel.yml代码如下

---
deployment:
  tasks:
    - export DEPLOYPATH=/home/cpanelUserName/public_html
    - /bin/cp * $DEPLOYPATH
    - /bin/cp/ -r * $DEPLOYPATH
    - /bin/chmod 755 ${DEPLOYPATH}
    - /bin/find ${DEPLOYPATH} -type d -exec /bin/chmod 755 '{}' \;
    - /bin/find ${DEPLOYPATH} -type f -exec /bin/chmod 644 '{}' \;

步骤5:推入Github存储库(已成功添加) 现在我登录到我的cpanel中,点击Git版本控制

创建了一个存储库

存储库图片如下:

步骤6:我从Cpanel ssh面板通过ssh创建了一个私钥,并在Github存储库中添加了部署密钥

步骤7:我刚刚使用以下命令将cpanel存储库ssh url添加到我的github存储库中

git remote add server ssh://myUserName@domain.com:21098/home/myUserName/repositories/myportfolio 
git push server
步骤8:我更改了web.php文件并将其添加到GitHub存储库中。(成功) 步骤9:我试图通过这个命令将更改上传到Cpanel

git remote add server ssh://myUserName@domain.com:21098/home/myUserName/repositories/myportfolio 
git push server
#注意:要求输入Cpanel密码。当密码有效时,它将在repositories/myportfolio目录中上载更改

Repositories/myportfolio目录在/home/myUsername目录中。我的意思是在public\u html目录之外

我可以更改存储库文件夹。但是,.cpanel.yml文件无法正常工作


现在该怎么办?

.cpanel.yml在服务器克隆存储库并在获取新更新后尝试部署时运行

您正在从计算机中推送存储库

您应该使用post-receive-hook