Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
217 lines (109 sloc) 6.17 KB

Included commands

These are all fab commands and are run this way:

$ fab command:option,anotheroption,yetanotheroption

For more information about Fabric, see the official docs.

Table of contents

Environment and branch commands

Environments

production

Work on production enviornment.

staging

Work on staging enviornment.

dev

Work on the development (vagrant) environment

Branches

branch:name

name -- Required. The name of the branch to switch to before running subsequent commands.

master

Work on development branch. Alias for branch:master

stable

Work on stable branch. Alias for branch:production

Database commands

For MySQL on Vagrant

vagrant.create_db:name

name -- The database to create. If none is specified, the value of env.project_name is used.

vagrant.destroy_db:name

name -- The database to destroy. If none is specified, the value of env.project_name is used.

vagrant.dump_db:dump,name

dump -- The filename to dump the database to. If none is specified, defaults to vagrant_dump.sql.

name -- The name of the database to dump. If none is specified, the value of env.project_name will be used.

vagrant.load_db:dump,name

dump -- Required. The path of the dump to load.

name -- The name the database to load the dump file into. If none is specified, the deploy tools will use the value of env.project_name.

vagrant.reload_db:dump,name

dump -- Required. The path of the dump to load.

name -- The name the database to reload the dump file into. If none is specified, the deploy tools will use the value of env.project_name.

For MySQL at localhost

local.create_db:name

name -- The database to create. If none is specified, the value of env.project_name is used.

local.destroy_db:name

name -- The database to destroy. If none is specified, the value of env.project_name is used.

local.dump_db:dump,name

dump -- The filename to dump the database to. If none is specified, defaults to local_dump.sql.

name -- The name of the database to dump. If none is specified, the value of env.project_name is used.

local.load_db:dump,name

dump -- Required. The path of the dump to load.

name -- The name the database to load the dump file into. If none is specified, the value of env.project_name is used.

local.reload_db:dump,name

dump -- Required. The path of the dump to load.

name -- The name the database to reload the dump file into. If none is specified, the deploy tools will use the value of env.project_name.

Deploying

dry_run

Don't transfer files, just output what would happen during a real deployment.

verbose

Show more information about what's happening as code is deployed.

deploy

Deploy local copy of repository to target WP Engine environment.

rollback

Deploy the most recent rollback point.

WordPress utilities

General WordPress utilities

wp.fetch_sql_dump

Fetches a recent database dump from WPEngine and saves it as mysql.sql in the root of your project directory.

wp.install:version

Downloads specified version of WordPress from https://github.com/WordPress/WordPress and installs it.

version -- Required. A version number to install (e.g. "3.9.1").

wp.verify_prerequisites

Checks to make sure you have curl (with ssh) and git-ftp installed, Attempts installation via brew if you do not.

Maintenance mode commands

wp.maintenance.start

Prevents users from logging into the WordPress dashboard by modifying your project's .htaccess file on the specified environment.

wp.maintenance.stop

Removes the barrier put in place by wp.maintenance.start.

wp.cmd:cmd_slug,json_data=None|output=None

cmd_slug -- Required. Your script/command slug.

json_data -- Path to json file with data to be sent over the wire to your script/command.

output -- Location to save any response content return by the script/command.

Run an admin/management script hosted on your WP Engine install.

This command looks for a PHP file in the /wp-scripts/ path of your install.

For example:

fab staging wp.cmd:menus_dump,blog_id=64

Makes an HTTP request to your staging environment for /wp-scripts/menus_dump.php.

See the wp-scripts repository for a sampling of scripts/commands.

You can save the output from your scripts/commands to a local file with the output argument.

For example:

fab production wp.cmd:menus_dump,blog_id=64,output=data/blog_64_menus.json

You can send JSON data over the wire using the json_data argument.

For example:

fab staging wp.cmd:menus_load,blog_id=64,json_data=data/blog_64_menus.json

Unit test scaffolding and test runner for plugins and themes

wp.tests.setup:theme_or_plugin

Generates files need to run PHPUnit tests for a plugin or theme included in your project.

theme_or_plugin -- Required The directory name of the plugin or theme to generate test files for.

wp.tests.run:theme_or_plugin

Runs PHPUnit tests for the specified theme or plugin. Displays results of the tests.

theme_or_plugin -- Required The directory name of the plugin or theme to run tests for.

General utilities

rollback

Deploy the most recent rollback point.

helpers.search_replace:file,search,replacement

This function is meant to help clean up a database dump so that it can be used for local development on the Vagrant box.

However, it can serve as a general search and replace function for any text file.

file -- Required. The path to the file to perform the search and replace operation on.

search -- Required. A string to search for in the file. For example: "largoproject.org"

replacement -- A string to replace your search term with. For example: "someotherdomain.com". If none is specified, defaults to "vagrant.dev."

You can’t perform that action at this time.