tbDeploymentToolsPlugin

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Stats

Plugin Information Installation
tbDeploymentToolsPlugin
Plugin image
1
user
Sign-in
to change
your status

tbDeploymentTools Plugin for sf 1.3 sf 1.4

The tbDeploymentToolsPlugin is a symfony plugin that provides tools to organise symfony project.

Installation

There are three ways to install the plugin:

symfony install (not yet available, sorry)

$ symfony plugin:install tbDeploymentToolsPlugin

git

$ git submodule add git://github.com/MrTB/tbDeploymentToolsPlugin.git plugins/tbDeploymentToolsPlugin

$ git submodule init

$ git submodule update

With subversion

$ svn propedit svn:externals plugins
  • In the editor that's displayed, add the following entry and then save

      tbDeploymentPlugin https://svn.github.com/MrTB/tbDeploymentToolsPlugin.git
    
  • Finally, update:

      $ svn up
    

Project Configurator

Imagine that you work with many developers in your project and you use Control Version System (aka subversion or git). Everybody have his own configurations like database settings and email in their own development environment. Staging and Live Environment have also their own configuration parameters.

You can surely always change the database.yml and app.yml, ignore the files in your control version system or add your own environment name in the files. But how is about the database password? It will be also clearly saved and everybody, that checked out the source codes, may also get know this.

tbDeploymentToolsPlugin helps you to configure your symfony project at another way.

  • Install the Plugin (see the Installation Section),

  • Enable the plugin in your ProjectConfiguration.class.php

    $this->enablePlugins('tbDeploymentToolsPlugin');
  • Copy the configuration.yml

    $ cp plugins/tbDeploymentToolsPlugin/skeleton/configuration.yml config/
    
  • Customise configuration.yml

  • Move your database.yml to database.yml.in

    $ mv config/database.yml config/database.yml.in
    
  • Set the placeholders (ex: ###DB_NAME###, etc)

    all:
      propel:
        class:        sfPropelDatabase
        param:
        classname:  PropelPDO
        dsn:        mysql:dbname=###DB_NAME###;host=###DB_HOST###
        username:   ###DB_USER###
        password:   ###DB_PASS###
        encoding:   utf8
        persistent: true
        pooling:    true
  • Test it by running symfony project:configure

    $ symfony project:configure
    
  • You could also dynamical another files like app.yml, just repeat the steps above.

Hints

Attention: the tbDeploymentToolsPlugin project environment is not same like the symfony application environment! Actually the symfony has no project environment

  • You can use one symfony project with different configuration if you call the project:configure with --env

    $ symfony project:configure --env=dev # this is a default project environment
    
    $ symfony project:configure --env=xyz # this will set your sf project to xyz environment
    
  • With the argument autoload you can automatically configure your project without input them again

    $ symfony project:configure autoload
    
  • Your cache file with saved placeholder values is in your home directory and has following format .{sf project name}-{project environment}.yml

Usage

symfony project:configure

Option:

  --env=[dev]

Argument:

   autoload : autoload the cache file

symfony project:assist

(to be implemented)

symfony project:multisync

(to be implemented)

symfony db:deploy

(to be implemented)

Todo

  1. Complete the inline method documentations ;)
  2. Implement project:assist, project:multisync db:deploy
  3. Unittests