I’m not a particularly good programmer, but I do know enough to know that there are aspects of my WordPress development that could benefit from being automated.
In this instance, the usual by-the-numbers setup stuff I do every time I start a new project. In an effort to do that, I’ve ventured into the world of bash scripting to pull together the basic things I do to get a new local copy of my blog going. Here it is, in all it’s glory. Please feel free to comment(constructively) if you feel it could be improved*. My eventual aim is to end up with something that generates dummy content and users etc, but that depends on me finding the time of course.
Points to bear in mind:
It takes a single argument – the name for your dev site and uses that to create a name for the db, password etc. i.e.:
$ sudo wp-setup.sh yoursitename
I do that because it’s simple to do and for dev purposes I’m not too fussy. However, there might be more subtle ideas that would make
moving to live easier. Something to think about for the future perhaps.
Note that it also uses sudo, to run the script as root. I do this as I’m editing the apache config files and I have to be root to do that, I think. Maybe there’s a simpler way of doing that, feel free to let me know.
This uses a git clone of the latest stable release from the WordPress svn repo. I do this because I’m familiar with git, but clearly adapting this to svn wouldn’t be too complicated.