
david at kineticode
Jul 30, 2008, 10:39 AM
Views: 1977
Permalink
|
Howdy, I was working with Dave Beaudet on the publish queuing patch at OSCON when I showed him the aliases I use to build and rebuild Bricolage as I hack on it, run tests, etc. The trick is that I essentially use `make dev` with different combinations of environment variables to get the build I want. The nice thing about `make dev` is that the `lib` and `conf` directories are aliased to the svn checkout, and it handles all of the database building stuff. Together with the environment variable stuff I've added to trunk, I can build and rebuild without any prompts. So Dave suggested I share the aliases with the list, as they'll help other developers to do development. So here they are: First, there's a function that does most of the work: bbuild() { killa sudo make $@ BRICOLAGE_SSL_CERT=/etc/ssl/certs/servercert.pem BRICOLAGE_SSL_KEY=/etc/ssl/private/serverkey.pem dev } The CERT stuff isn't used for all my builds (not all use SSL), but they're ignored if they're not needed. The `killa` line is just an alias to shut down Bricolage if it's running: alias killa="sudo /usr/local/bricolage/bin/bric_apachectl stop" Now here are all of my build aliases: alias pbuilds="bbuild BRICOLAGE_HTTPD_VERSION=apache2 BRICOLAGE_DB_TYPE=Pg BRICOLAGE_SSL=1" alias pbuilds1="bbuild BRICOLAGE_HTTPD_VERSION=apache BRICOLAGE_DB_TYPE=Pg BRICOLAGE_SSL=1" alias mbuilds="bbuild BRICOLAGE_HTTPD_VERSION=apache2 BRICOLAGE_DB_TYPE=mysql BRICOLAGE_SSL=1" alias mbuilds1="bbuild BRICOLAGE_HTTPD_VERSION=apache BRICOLAGE_DB_TYPE=mysql BRICOLAGE_SSL=1" alias pbuild="bbuild BRICOLAGE_HTTPD_VERSION=apache2 BRICOLAGE_DB_TYPE=Pg BRICOLAGE_SSL=0" alias pbuild1="bbuild BRICOLAGE_HTTPD_VERSION=apache BRICOLAGE_DB_TYPE=Pg BRICOLAGE_SSL=0" alias mbuild="bbuild BRICOLAGE_HTTPD_VERSION=apache2 BRICOLAGE_DB_TYPE=mysql BRICOLAGE_SSL=0" alias mbuild1="bbuild BRICOLAGE_HTTPD_VERSION=apache BRICOLAGE_DB_TYPE=mysql BRICOLAGE_SSL=0" So they just vary the version of Apache, the RDBMS, and the SSL support. They all run for me without any prompts, so I can rebuild Bricolage in about a minute if I want to switch databases or Apache Web servers (as when I'm running Unit tests and want to make sure that everything passes in all environments). Be warned, however, that these aliases always drop and recreate the database, so if you have test data you want to keep, you'll need to dump and restore the database yourself. Hope you find this useful. Happy hacking! Best, David
|