cpanel 中用于部署多个子文件夹和文件的 yml 文件
Yml file in cpanel for deploying multiple subfolder and files
我已经使用 GitHub 存储库配置了 CPanel,但是我无法正确编写我的 .cpanel.yml 文件,因为当我尝试部署 HEAD 提交时没有执行。这是我的 .yml:
---
deployment:
tasks:
- export DEPLOYPATH=/home/tita8rfx/public_html/try/protected
- /bin/cp -r components $DEPLOYPATH
- /bin/cp -r controllers $DEPLOYPATH
- export DEPLOYPATH=/home/tita8rfx/public_html/try/assets
- /bin/cp style.css $DEPLOYPATH
- /bin/cp app.js $DEPLOYPATH
- export DEPLOYPATH=/home/tita8rfx/public_html/try/protected/views
- /bin/cp -r app $DEPLOYPATH
我也试过了:
---
deployment:
tasks:
- export DEPLOYPATH=/home/tita8rfx/public_html/try
- /bin/cp -r /protected/components $DEPLOYPATH
- /bin/cp -r /protected/controllers $DEPLOYPATH
- /bin/cp /assets/style.css $DEPLOYPATH
- /bin/cp /assets/app.js $DEPLOYPATH
- /bin/cp -r /protected/views/app $DEPLOYPATH
我想让这段代码做的是修改以下文件夹:
- /home/tita8rfx/public_html/try/protected/components
- /home/tita8rfx/public_html/try/protected/controllers
- /home/tita8rfx/public_html/try/protected/views/app
和以下文件:
- /home/tita8rfx/public_html/try/assets/style.css
- /home/tita8rfx/public_html/try/assets/app.js
但是没有执行或错误,我无法理解问题所在。
我想我已经找到我的问题了。这是解决方案。我必须在应该获取更新数据的路径上更加状语。
---
deployment:
tasks:
- export DEPLOYPATH=/home/tita8rfx/public_html/titanbg-hs.com/protected
- /bin/cp -r /home/tita8rfx/repositories/hsapp/protected/components $DEPLOYPATH
- /bin/cp -r /home/tita8rfx/repositories/hsapp/protected/controllers $DEPLOYPATH
- /bin/cp -r /home/tita8rfx/repositories/hsapp/protected/models $DEPLOYPATH
- export DEPLOYPATH=/home/tita8rfx/public_html/titanbg-hs.com/assets
- /bin/cp /home/tita8rfx/repositories/hsapp/assets/style.css $DEPLOYPATH
- /bin/cp /home/tita8rfx/repositories/hsapp/assets/app.js $DEPLOYPATH
- export DEPLOYPATH=/home/tita8rfx/public_html/titanbg-hs.com/protected/views
- /bin/cp -r /home/tita8rfx/repositories/hsapp/protected/views/app $DEPLOYPATH
- /bin/cp -r /home/tita8rfx/repositories/hsapp/protected/views/tpl $DEPLOYPATH
我希望这能帮助到和我有同样问题的人。
我已经使用 GitHub 存储库配置了 CPanel,但是我无法正确编写我的 .cpanel.yml 文件,因为当我尝试部署 HEAD 提交时没有执行。这是我的 .yml:
---
deployment:
tasks:
- export DEPLOYPATH=/home/tita8rfx/public_html/try/protected
- /bin/cp -r components $DEPLOYPATH
- /bin/cp -r controllers $DEPLOYPATH
- export DEPLOYPATH=/home/tita8rfx/public_html/try/assets
- /bin/cp style.css $DEPLOYPATH
- /bin/cp app.js $DEPLOYPATH
- export DEPLOYPATH=/home/tita8rfx/public_html/try/protected/views
- /bin/cp -r app $DEPLOYPATH
我也试过了:
---
deployment:
tasks:
- export DEPLOYPATH=/home/tita8rfx/public_html/try
- /bin/cp -r /protected/components $DEPLOYPATH
- /bin/cp -r /protected/controllers $DEPLOYPATH
- /bin/cp /assets/style.css $DEPLOYPATH
- /bin/cp /assets/app.js $DEPLOYPATH
- /bin/cp -r /protected/views/app $DEPLOYPATH
我想让这段代码做的是修改以下文件夹:
- /home/tita8rfx/public_html/try/protected/components
- /home/tita8rfx/public_html/try/protected/controllers
- /home/tita8rfx/public_html/try/protected/views/app
和以下文件:
- /home/tita8rfx/public_html/try/assets/style.css
- /home/tita8rfx/public_html/try/assets/app.js
但是没有执行或错误,我无法理解问题所在。
我想我已经找到我的问题了。这是解决方案。我必须在应该获取更新数据的路径上更加状语。
---
deployment:
tasks:
- export DEPLOYPATH=/home/tita8rfx/public_html/titanbg-hs.com/protected
- /bin/cp -r /home/tita8rfx/repositories/hsapp/protected/components $DEPLOYPATH
- /bin/cp -r /home/tita8rfx/repositories/hsapp/protected/controllers $DEPLOYPATH
- /bin/cp -r /home/tita8rfx/repositories/hsapp/protected/models $DEPLOYPATH
- export DEPLOYPATH=/home/tita8rfx/public_html/titanbg-hs.com/assets
- /bin/cp /home/tita8rfx/repositories/hsapp/assets/style.css $DEPLOYPATH
- /bin/cp /home/tita8rfx/repositories/hsapp/assets/app.js $DEPLOYPATH
- export DEPLOYPATH=/home/tita8rfx/public_html/titanbg-hs.com/protected/views
- /bin/cp -r /home/tita8rfx/repositories/hsapp/protected/views/app $DEPLOYPATH
- /bin/cp -r /home/tita8rfx/repositories/hsapp/protected/views/tpl $DEPLOYPATH
我希望这能帮助到和我有同样问题的人。