wearerequired/composer-deployer

一个用于创建部署配置文件(deploy.php)的 Composer 插件。

安装次数: 15,112

依赖项: 0

建议者: 0

安全: 0

星标: 5

关注者: 2

分支: 1

开放问题: 1

类型:composer-plugin

v1 2024-04-09 06:55 UTC

This package is auto-updated.

Last update: 2024-09-09 07:47:36 UTC


README

Latest Stable Version Latest Unstable Version

一个用于 Composer 创建 Deployer 配置文件(deploy.php)的插件。

安装

通过 Composer

composer require wearerequired/composer-deployer

特性

  • 支持 Deployer v7。
  • 在项目根目录中创建 deploy.php
  • 定义一个 deploy 任务以部署项目。
  • 如果设置了 wp_languages 选项,则通过 WP-CLI 安装和更新 WordPress 翻译。
  • 通过 WP-CLI 清除 OPcache(需要 WP-CLI Clear OPcache)。可以通过 wp_clear_opcache 选项禁用。
  • 如果设置了 wordpress 选项,则运行 WordPress 数据库常规操作。
  • 在部署完成后通过 post_rollout_commands 选项运行自定义命令。
  • 提供GitHub 部署的可重用工作流程

配置

deploy.php 旁边,您应该在项目根目录中创建一个 deploy.yml 文件。有关支持的语法,请参阅 Deployer 文档 或以下示例

.base: &base
  hostname: ssh.example.ch
  remote_user: jane
  application: example.ch
  repository: git@github.com:wearerequired/example.git
  deploy_path: ~/public_html/{{application}}/{{stage}}
  branch: main
  shared_files:
    - wordpress/.htaccess
  shared_dirs:
    - wordpress/content/uploads
  wp_languages:
    - de_DE
    - de_DE_formal
    - de_CH
  wp_clear_opcache: true
  post_rollout_commands:
    - "{{bin/wp}} litespeed-purge all || true"

hosts:
  staging:
    <<: *base
    labels:
      stage: staging

  production:
    <<: *base
    branch: production
    shared_files:
      - wordpress/.htaccess
      - wordpress/google123456789abc.html
    labels:
      stage: production

a required open source product - let's get in touch