Install wordpress with a single command, both local and on your development environment, with git offcourse. Bootstrap will be downloaded to the themes folder aswell.
Remember to have MAMP or whatever you use turned on!
- Open the script in a text editor and change the creds.
- Save the script in your bash scripts folder. Remember to chmod it so its executable. (chmod +x instawp)
- Open a shell, cd to your localhost directory and type "instawp myprojectname"
- Spend some time with your coffee cup while the script does your job!
You only have to do step 1 and 2 once :)
This is a step by step description of what the script does
-
Script is initiated with instawp myproject. myproject will be used for folder name and database name
-
Cd to $LocalPath and create the myproject folder
-
Initiate a bare git repository
-
Cd to hooks and create a post receive hook that checks out all the files.
-
Chmod +x the hook so its executable
-
cd back to the $LocalPath and scp the myproject folder to the server
-
Remove the bare repo to get a clean start
-
Re-initialise git
-
Download the latest wordpress install, unzip it, pull out all the files and delete the folder and the zip file.
-
Create a .gitignore and add wp-config-local.php to it.
-
Commit, add remote server (origin) and push.
-
Create the wp-config file and add credentials for the remote. We allso write some php to check if wp-local-config.php exists. This is all done with sed.
-
Create the wp-local-config and add creds
-
Download twitter bootstrap into wp-content/themes/bootstrap
-
Commit and push to server
-
Create the databases. We use ssh to do this on the server
-
Use curl to initiate the famous wordpress 5 min install both local and on server. More like 1 sec for us though.
-
We are all done :)