Block8/PHPCI — pull request #59 by kamermans (2013-05-22 20:00:18+00:00)
Title: Variable interpolation support

Support is built into the core now, via `Builder::interpolate()`, and I've added support to the `Mysql` and `Env` plugins.

Similar to the Env plugin, the following vars are interploated (with example values):

%PHPCI% =1
%PHPCI_COMMIT% =52e9aba3fae11c3b1db11f4d36b72c2862ea3cf0
%PHPCI_PROJECT% =3
%PHPCI_BUILD% =61
%PHPCI_PROJECT_TITLE% =MyApp
%PHPCI_BUILD_PATH% =/opt/PHPCI/build/project3-build61/

I am using it with the MySQL plugin. It looks a little nasty, but it works as expected:

setup:
mysql:
- "DROP DATABASE IF EXISTS phpci_project%PHPCI_PROJECT%_build%PHPCI_BUILD%;"
- "CREATE DATABASE phpci_project%PHPCI_PROJECT%_build%PHPCI_BUILD%;"
- "GRANT ALL PRIVILEGES ON phpci_project%PHPCI_PROJECT%_build%PHPCI_BUILD%.* TO phpunit_tester@'localhost' IDENTIFIED BY 'phpunit';"
- import: { file: "protected/data/database.sql", database: phpci_project%PHPCI_PROJECT%_build%PHPCI_BUILD% }
complete:
mysql:
- "DROP DATABASE IF EXISTS phpci_project%PHPCI_PROJECT%_build%PHPCI_BUILD%;"