The many combinations for workflows your team can use, will no doubt make it difficult in deciding how to begin working with WordPress within Pantheon. This is intended to provide you a simple workflow for maintaining your WordPress intallation.
As you read through, remember that this is not the "end all be all" solution. This is a guideline intended to give you an immediate path to follow. You can alter, or come up with alternatives down the road.
- You have created a new website.
- You are using a WordPress distribution.
- You have switched your connection mode to Git.
- You are familiar with Git and terminal commands.
You should have access to a Git URL along the lines of:
ssh://codeserver.dev.[somenumbers]@codeserver.dev.[morenumbers].drush.in:2222/~/repository.git myproject
So we're going to shorten that to:
git clone ssh://reallylongurl:2222/~/repository.git myproject
There are a few options.
- Clone down your Pantheon repository, setup a local environment and run the built in WordPress updater. This is typically done through the administration screen of WordPress.
- Clone down your Pantheon repository and run the following commands:
cd myprojectmv wp-content /tmpmv wp-config.php /tmprm -vR \.*<< Get rid of hidden files.rm -vR *<< Get rid of all other files.wget wordpress.org/latest.zipunzip latest.zipmv wordpress/* .rm -vR wordpressrm -vR wp-contentmv /tmp/wp-content .mv /tmp/wp-config.php .
Your upgrade should be good now :)
OR Wait for Pantheon to provide you with the upgrade themselves and then merge the commit.
cd myproject
Now that we are in the cloned project, let's add a Theme.
git remote add -f theme [email protected]:username/ourtheme.git
With -f option, git fetch is run immediately after the remote information is set up.
From here on out you can get updates for your theme like this:
git fetch themegit subtree pull --prefix wp-content/themes/ourtheme theme --sqaush
Then you can push up to Pantheon!
You can do the exact same thing with a plugin, here's how.
git remote add -f plugin [email protected]:username/ourplugin.git
Then your process will be:
git fetch plugingit subtree pull --prefix wp-content/plugins/ourplugin plugin --sqaush