Development

Changeset 7766

You must first sign up to be able to contribute.

Changeset 7766

Show
Ignore:
Timestamp:
03/07/08 15:25:43 (7 months ago)
Author:
fabien
Message:

added a 'rsync-dir' option to the project:deploy task (closes #3032)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/task/project/sfProjectDeployTask.class.php

    r7743 r7766  
    3030    $this->addOptions(array( 
    3131      new sfCommandOption('go', null, sfCommandOption::PARAMETER_NONE, 'Do the deployment'), 
     32      new sfCommandOption('rsync-dir', null, sfCommandOption::PARAMETER_REQUIRED, 'The directory where to look for rsync*.txt files', 'config'), 
    3233    )); 
    3334 
     
    4445The server must be configured in [config/properties.ini|COMMENT]: 
    4546 
    46   [[production] 
     47  [production] 
    4748    host=www.example.com 
    4849    port=22 
     
    6970 
    7071You can also create a [rsync.txt|COMMENT] and [rsync_include.txt|COMMENT] files. 
     72 
     73If you need to customize the [rsync*.txt|COMMENT] files based on the server, 
     74you can pass a [rsync-dir|COMMENT] option: 
     75 
     76  [./symfony project:deploy --go --rsync-dir=config/production production|INFO] 
    7177EOF; 
    7278  } 
     
    128134    { 
    129135      $parameters = '-azC --force --delete'; 
    130       if (file_exists('config/rsync_exclude.txt')) 
     136      if (file_exists($options['rsync-dir'].'/rsync_exclude.txt')) 
    131137      { 
    132         $parameters .= ' --exclude-from=config/rsync_exclude.txt'
     138        $parameters .= sprintf(' --exclude-from=%s/rsync_exclude.txt', $options['rsync-dir'])
    133139      } 
    134140 
    135       if (file_exists('config/rsync_include.txt')) 
     141      if (file_exists($options['rsync-dir'].'/rsync_include.txt')) 
    136142      { 
    137         $parameters .= ' --include-from=config/rsync_include.txt'
     143        $parameters .= sprintf(' --include-from=%s/rsync_include.txt', $options['rsync-dir'])
    138144      } 
    139145 
    140       if (file_exists('config/rsync.txt')) 
     146      if (file_exists($options['rsync-dir'].'/rsync.txt')) 
    141147      { 
    142         $parameters .= ' --files-from=config/rsync.txt'
     148        $parameters .= sprintf(' --files-from=%s/rsync.txt', $options['rsync-dir'])
    143149      } 
    144150    }