wearerequired / composer-deployer
A composer plugin to create a deployer configuration file.
Installs: 15 736
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 1
Open Issues: 1
Type:composer-plugin
Requires
- php: >=7.4
- composer-plugin-api: ^2.0
Requires (Dev)
- composer/composer: ^2.0
- composer/semver: ^3.0
- dealerdirect/phpcodesniffer-composer-installer: ^0.7 || ^1.0
- deployer/deployer: ^7.3
- wearerequired/coding-standards: ^6.0
README
A plugin for Composer to create the Deployer configuration file (deploy.php).
Installation
Via Composer
composer require wearerequired/composer-deployer
Features
- Supports for Deployer v7.
- Creates
deploy.php
in project root directory. - Defines a
deploy
task to deploy a project. - Installs and updates WordPress translations via WP-CLI if
wp_languages
option is set. - Clears OPcache via WP-CLI (requires WP-CLI Clear OPcache). Can be disabled via
wp_clear_opcache
option. - Runs WordPress database routine if
wordpress
option is set. - Runs custom commands via
post_rollout_commands
option before the deployment is finished. - Provides a reusable workflow for GitHub for deployment.
Configuration
Next to deploy.php
you should create a deploy.yml
file in the project root directory. For the supported syntax see Deployer's documentation or the following example:
.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