putyourlightson/craft-blitz-shell

Craft CMS Blitz 插件的 Shell 部署器。

3.0.0 2024-04-08 14:06 UTC

This package is auto-updated.

Last update: 2024-09-08 15:21:26 UTC


README

Stable Version Total Downloads

Blitz Shell 部署器 for Craft CMS

Shell 部署器允许 Blitz 插件为 Craft CMS 将缓存文件部署到远程位置,使用 shell 命令。

警告:命令将通过您操作系统的 shell 进行解析。请自行承担风险。

用法

使用 composer 安装部署器。

composer require putyourlightson/craft-blitz-shell

然后在 config/blitz.php 中的 driverTypes 配置设置中添加类。

// The deployer type classes to add to the plugin’s default deployer types.
'deployerTypes' => [
    'putyourlightson\blitzshell\ShellDeployer',
],

您可以选择部署器并在控制面板或 config/blitz.php 中添加要执行的 shell 命令。shell 命令也可以在 config/blitz.php 中的 deployerSettings 设置中定义为一个数组数组。

// The deployer type to use.
'deployerType' => 'putyourlightson\blitzshell\ShellDeployer',

// The deployer settings.
'deployerSettings' => [
   'commands' => [
        ['cp -r ~/mysite.com/web/cache/blitz ~/remote'],
        ['cp -r ~/mysite.com/web/cache/blitz ~/remote'],
        ['cp -r ~/mysite.com/web/cache/blitz ~/remote'],
    ],
],

文档

请参阅 putyourlightson.com/plugins/blitz 上的文档。

PutYourLightsOn 创建。