Staging
Production
Accessing Staging and Production (set in WP Engine Utilities)
- username: metafluidics
- password: bocoup
WP Engine Admin
- An "Administrator" has full access to the WP Admin and may add or remove "User" and "Administrator" accounts.
- The currently logged-in Administrator may not remove their own account.
In the WP Admin, choose Users in the left nav.
- Click Add New under Users in the left nav.
- Enter all relevant information.
- Select the Role of Administrator.
- Click Add New User when done.
In the WP Admin, choose Users in the left nav.
- Click the name of the User in the list or hover over the name of the User, then click Edit.
- Modify User data.
- Click Update Profile when done.
In the WP Admin, choose Users in the left nav.
- Hover over the name of the User, then click Delete.
- On the next page, ensure Delete all content is selected.
- Click Confirm Deletion when done.
The following instructions are based on the Deploy your WP Engine hosted application with the ease of Git guide. If you have any questions about this process that aren't covered here, be sure to check the Deploying to Production, Deploying to Staging, and FAQs sections of that guide.
Also note that in the following examples, the $
is used to simulate a bash
shell prompt. Don't type in the $
.
Adding an SSH key to WP Engine should only need to be done once per user, per site. The presence of an SSH key is what allows a user to deploy to WP Engine.
If you don't already have a public key, create one by following the GitHub Generating SSH keys guide.
Ensure your public key has been added to the WP Engine fpdashboard "Git Push" page, following the instructions therein.
Adding Git remotes should only need to be done once per repository clone. Once these remotes have been added, pushing to staging and production becomes possible.
Add this site's staging and production Git remotes by running this command:
$ ./deploy/setup-remotes.sh
You can verify that the Git remotes were added like so:
$ git remote -v
origin https://github.com/bocoup/ll-metafluidics-site.git (fetch)
origin https://github.com/bocoup/ll-metafluidics-site.git (push)
production git@git.wpengine.com:production/metafluidics.git (fetch)
production git@git.wpengine.com:production/metafluidics.git (push)
staging git@git.wpengine.com:staging/metafluidics.git (fetch)
staging git@git.wpengine.com:staging/metafluidics.git (push)
Deploying the master
branch to staging:
$ git push staging master
Deploying the localbranchname
feature branch to staging:
$ git push staging localbranchname:master
Deploying the master
branch to production:
$ git push production master
https://my.wpengine.com/installs/metafluidics/phpmyadmin
- Staging database:
snapshot_metafluidics
- Production database:
wp_metafluidics
Development of the site should proceed like so:
- Run
vagrant up
- Browse to http://metafluidics.loc/wp-admin.php
- Log into the wp-admin with the credentials:
admin
/admin
- Create a feature branch.
- Make changes to files in wp-content.
- Run
vagrant ssh -c 'sudo service php5-fpm restart'
- Refresh the browser to see your changes.
- Repeat steps 5-7 until done, committing changes when appropriate.
- Push your branch to
staging
and test the staging site. - Repeat steps 5-9 until done.
- Merge your feature branch into
master
. - Push
master
toorigin
. - Run
vagrant destroy
to stop and delete the Vagrant box.
The following will need to be installed on your local development machine before you can use this workflow. All versions should be the latest available, as some required features may not be available in older versions.
- Ansible 1.9.2
- Install
ansible
via apt (Ubuntu), yum (Fedora), homebrew (OS X), etc. See the Ansible installation instructions for detailed, platform-specific information.
- Install
- VirtualBox
- Download (All platforms)
- Install
virtualbox
via homebrew cask (OS X)
- Vagrant
- Download (All platforms)
- Install
vagrant
via homebrew cask (OS X)
- vagrant-hostsupdater
- Install with
vagrant plugin install vagrant-hostsupdater
(All platforms)
- Install with
- deploy/ansible/group_vars/all.yml - Global variables. These settings are available to all playbooks and roles.
- provision - Install all dependencies required
to build the base box.
- base role - Install Apt packages.
- configure - Configure the box and get services
set up. The following roles may be run individually via a role-named tag, eg.
--tags=wordpress
:- configure role - Basic server configuration.
- users role - Enable user account for the
currently logged-in user so that playbooks may be run manually via
run-playbook.sh
oransible-playbook
. - nginx role - Enable SSL (if specified) and configure nginx.
- php role - Update php configuration.
- mysql role - Harden MySQL installation.
- wordpress role - Download and install
WordPress
wp_version
and set up its configuration, linking the wp-content directory. Use thewp_force=true
extra var to force the currently-installed version of WordPress to be reinstalled. - postfix role - Configure the SMTP email server.
- db-dump - Dump
wp_db_name
database to db-named file inwp-database
. - db-restore - Restore
wp_db_name
database from db-named file inwp-database
. - init - Run
provision
,configure
anddb-restore
playbooks. Runs onvagrant up
.
# Run all configure playbook roles:
$ ./deploy/run-playbook.sh configure vagrant
# Run configure playbook role tagged "wordpress":
# (valid tags are: configure, mysql, nginx, php, users, wordpress, postfix)
$ ./deploy/run-playbook.sh configure vagrant --tags=wordpress