Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable interpolation support #59

Merged
merged 4 commits into from
May 22, 2013

Conversation

kamermans
Copy link
Contributor

See #52

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%;"

dancryer added a commit that referenced this pull request May 22, 2013
@dancryer dancryer merged commit c1bf4ab into dancryer:master May 22, 2013
@ghost ghost assigned kamermans May 22, 2013
prezire pushed a commit to prezire/PHPCI that referenced this pull request Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants