Code Monkey home page Code Monkey logo

wp-deploy-flow's Introduction

wp-deploy-flow

A wp-cli command to deploy your wordpress instance.

Dependencies

Install - Usage

Check here : http://demental.info/blog/2013/04/09/a-decent-wordpress-deploy-workflow/

Setting up environments

You can create as many environments as you want, all the environments must be setup in your wp-config.php file, with prefixed constants.

For example if you want to create a staging environment, create all the necessary constants to configure it such as : STAGING_DB_HOST, STAGING_DB_USER, STAGING_URL and so on .... And copy all those configuration constats to all the other environments you want to interact with.

Available constants:

[ENV]_DB_HOST / USER / NAME / PORT / PASSWORD

  • Database dsn for the environment
  • Mandatory: Yes except for port (default 3306)

[ENV]_SSH_DB_HOST / USER / PATH / PORT

  • If you need to connect to the destination database through SSH
  • Mandatory: No, port defaults to 22

[ENV]_SSH_HOST / USER / PORT

  • SSH host to sync with Rsync
  • Mandatory: No, port defaults to 22

[ENV]_PATH

  • Server path for the environment (used to reconfigure the Wordpress database)
  • Mandatory: Yes

[ENV]_URL

  • Url of the Wordpress install for this environment (used to reconfigure the Wordpress database)
  • Mandatory: Yes

[ENV]_EXCLUDES

  • Add files to exclude from rsync (a good idea is - temporarily I hope - to remove .htaccess to avoid manual flush rewrite). List must be separated buy semicolons.
  • Mandatory: No

Local deployment

wp-deploy-flow command is a nice tool to have a draft copy of your website, play with your draft, do whatever mistake and roll back from production to staging, or for preparing a big update and deploy in a snap. Although it's best to have separate servers for each environments, you still can have your draft environment on the same HTTP server, in a subfolder or a subdomain. For same-server environments, the configuration is much simpler : you just need to fill the PATH, URL, DB_HOST / USER / NAME / PASSWORD for each environment, SSH will not be used in this case. If one environemnt is in a subfolder of the other, it will be automatically excluded from rsync copy to avoid infinite recursion.

Usage

wp-deploy-flow comes includes:

  • four subcommands : pull, pull_files, push and push_files
  • one flag : --dry-run as you can guess this flag allows you to see what SSH commands will be executed before actually launching them.

All subcommands have the same signature :

wp deploy <subcommand> <environment> [--dry-run]

Testing

Shame on me... No automated tests, this is manually tested, but I recently redesigned the code so it should be easier now to cover the project (at least the core classes : puller and pusher).

If you want to contribute, be kind, send a PR I will be happy to review and merge !

wp-deploy-flow's People

Contributors

demental avatar c10b10 avatar nubz avatar samsamai avatar

Watchers

Eduardo Pintor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.