Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.

Environment Management

Charlie Rosenbury edited this page Jan 11, 2015 · 8 revisions
"environments": {
	"local" : { ... }
	"staging" : { ... }
	"production" : { ... }
}

Default: none

The environments setting contains objects within it defining each environment. Currently, each environment should match a branch of the repository.

There are several other environment-related settings that exist outside of the "environments" object:

DB Master

"db_master": "development"

Default: none

The environment whose uploads and database should be treated as master. This value gets used for shorthand migration tasks in which the environment is not explicitly stated.

Uploads Sync Method

"uploads_sync": "copy"

Default: none

The method of uploading/downloading WP uploads

Values

"copy": Use each environments' "migrate_uploads_method" to move files up and down.

"rewrite": Inserts a rewrite rule in WP's .htaccess file to rewrite all requests to the local uploads folder to "db_master"'s uploads directory

Local Environment Alias

"alias_local_env": "production"

Default: none

This setting is useful on build servers in which the local environment is one of the shared environments (i.e. "development" or "production"). Upon running HelperPress, all settings inside of this specified environment are copied into the "local" environment configuration. Note that any defined properties within the "local" environment will override those in the aliased environment.

Individual Environments

Each individual environment should be defined within the "environments" setting.

The following settings should go within an individual environment definition.

Title

"title": "Client Dev Server"

required

A human-readable title that gets logged sometimes.

Server SSH Settings (and SFTP)

"ssh": {
	"host": "dev01.40digits.net",
	"port": 22,
	"user": "kewld00d69"
	"pass": "password1234"
	"keyfile": "~/.ssh/customkey.rsa"
	"passphrase": "myKeysPassphrase"
}

required

SSH information used for any rsync or sftp tasks. All fields besides "host" are optional. Omitted properties will (should) be inferred by the software. If not, please report a bug.

Database Settings

"db": {
	"host": "127.0.0.1",
	"pass": "password",
	"user": "db-user"
	"database": "my-wp"
}

required

These credentials are used in the generated wp-config.php file as well as in database operations that take place over SSH. Therefore the host address should be relative to the server.

WordPress Path

"wp_path": "/var/www/my-wp-install"

required

The absolute path to your WordPress root folder. This value is used for the Search & Replace functionality as well as SSH tasks that reference the install directory.

(S)FTP WordPress Path

"ftp_wp_path": "public_html"

Default: value of "wp_path"

The base directory of your FTP or SFTP user. In other words, it's what your FTP editor considers to be "/". This value is used in FTP tasks. If your public html folder is the root of your FTP user's directory (i.e. you are dumped into the public folder upon logging in via FTP), use "." as this value.

Home URL

"home_url": "my-project.staging.ourcompany.net"

required

The home URL of your WP site. It is used to determine how to access the HelperPress WP Plugin as well as in the database migration search and replace.

Deploy Method

"deploy_method": "rsync"

The method HelperPress should use when running the deploy task.

Values

"rsync": Use rsync over SSH to deploy WP core, plugins, and the theme.

"wpe": Clone the current repository from WPEngine, copy build files on top of it, commit the differences, and push. Note that this method required "remote" to be defined (see below.)

"none": Prevent deploy task from running.

WPEngine Git Remote

"remote": "git@git.wpengine.com:production/sitename.git"

optional, unless "deploy_method" is set to "wpe"

The remote repository tracked by WPEngine.

Uploads Migration Method

"migrate_uploads_method": "rsync"

Default: "none"

How HelperPress should migrate uploads to and from this environment.

Values

"rsync": Use rsync over SSH.

"sftp": Copy every file every time over SFTP.

"none": Prevent migrate_uploads task from running.

Database Migration Method

"migrate_db_method": "ssh"

Default: "none"

How HelperPress should migrate the database to and from this environment.

Values

"ssh": Use mysqldump over SSH.

"plugin": Use a combination of SFTP and WP Plugin to move data.

"none": Prevent migrate_db task from running.

HelperPress WordPress Plugin API Key

"hp_wp_api_key": "260e31ca38cfaa782666d16293ff9a9845e3a9271666"

Default: none

This is the API key used to communicate with teh WordPress plugin. It gets set automatically via SFTP, so you should never need to set/unset this.

Clone this wiki locally