2017 © Pedro Peláez
 

library deployer-wp-recipes

Wordpress deployer recipes

image

cstaelen/deployer-wp-recipes

Wordpress deployer recipes

  • Wednesday, March 22, 2017
  • by cstaelen
  • Repository
  • 1 Watchers
  • 9 Stars
  • 126 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 11 Versions
  • 4 % Grown

The README.md

Deployer WP Recipes

For the record, those recipes was written using a personal Wordpress stack based on Bedrock (Thanks to the great roots.io team), using phpdotenv package. But it can be used in many other configuration ., (*1)

Features

  • Deploy repository code with gulp compiled files
  • Sync Wordpress uploads
  • Pull and push Wordpress database
  • Clean up some files

Requirements

Installation

Make sure to include recipe files in your deploy.php:, (*2)

require 'vendor/cstaelen/deployer-wp-recipes/recipes/assets.php';
require 'vendor/cstaelen/deployer-wp-recipes/recipes/cleanup.php';
require 'vendor/cstaelen/deployer-wp-recipes/recipes/db.php';
require 'vendor/cstaelen/deployer-wp-recipes/recipes/uploads.php';

Configuration

Just add those lines below in your deploy.php with your own values :, (*3)

set('wp-recipes', [
    'theme_name'        => 'Your WP theme folder name',
    'theme_dir'         => 'path/to/your/theme/folder',
    'theme_dist'        => 'theme_release', // Will be rename with theme_name
    'wwwroot_dir'       => 'web', //VHOST ROOT DIR
    'shared_dir'        => '{{deploy_path}}/shared', 
    'gulp_cmd'          => 'gulp build',
    'assets_dist'       => 'path/to/theme/folder/dist',
    'local_wp_url'      => 'http://local.dev',
    'remote_wp_url'     => 'http://mywebsite.com',
    'clean_after_deploy'=>  [
        'deploy.php',
        '.gitignore',
        '*.md'
    ]
]);

Available tasks

Upload your WP database : dep db:push prod Download your WP database : dep db:pull prod Sync WP uploads with rsync : dep uploads:sync prod, (*4)

You can also use those rules below in your deploy.php file to compile and deploy assets and cleanup some useless files on your staging/production server :, (*5)

after('deploy', 'deploy:assets');
after('deploy', 'deploy:cleanup');

WP recipes using phpdotenv

If you are using phpdotenv to configure your servers as the awesome Bedrock Wordpress Stack do, you can use those task rules below to grab WP_HOME value filled in your .env file., (*6)

before('db:cmd:pull', 'env:uri');
before('db:cmd:push', 'env:uri');

In order to do that, we assume your local .env file is in the root project folder, and the remote one in the repo shared folder., (*7)

Make sure to leave empty those config values :, (*8)

set('wp-recipes', [
    ...
    'local_wp_url'      => '',
    'remote_wp_url'     => ''
    ...
]);

The Versions

22/03 2017

dev-master

9999999-dev

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Avatar cstaelen

22/03 2017

0.1.0

0.1.0.0

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Avatar cstaelen

22/02 2017

0.0.9

0.0.9.0

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Avatar cstaelen

21/02 2017

0.0.8

0.0.8.0

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Avatar cstaelen

21/02 2017

0.0.7

0.0.7.0

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Avatar cstaelen

21/02 2017

0.0.6

0.0.6.0

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Avatar cstaelen

15/02 2017

0.0.5

0.0.5.0

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar cstaelen

16/08 2016

0.0.4

0.0.4.0

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar cstaelen

11/08 2016

0.0.3

0.0.3.0

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar cstaelen

07/07 2016

0.0.2

0.0.2.0

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar cstaelen

05/07 2016

0.0.1

0.0.1.0

Wordpress deployer recipes

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar cstaelen