Changeset 115

Show
Ignore:
Timestamp:
07/01/07 17:07:50 (2 years ago)
Author:
mbailey
Message:

merged 1-7-stable branch changes r74:114 into the trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r74 r115  
    33== SVN 
    44 
     5* bugfix :setup_svn no longer stomps on :repository config item 
     6* new task :generate_database_yml creates shared/config/database.yml on server [Mike Bailey] 
     7* new config item :database_yml_in_scm causes shared/config/database.yml to be symlinked after deploy if set to false [Mike Bailey] 
     8* added defaults to prompt-> Capistrano::CLI.prompt('Enter database host', 'localhost') [Mike Bailey] 
     9 
     10== 1.8.0 
     11 
     12* fixed scm_setup. it parses :repository if set and prompts user for values if not [Mike Bailey] 
     13* added "role :scm, domain" to generated deploy.rb [Mike Bailey] 
     14* added :trac_install, :trac_setup, :trac_start, :trac_stop  [Mike Bailey] 
     15* added :change_root_password and :change_root_password_as_root [Mike Bailey] 
     16* moved templates dir [Mike Bailey] 
     17* bugfix :db_setup now re-runnable 
     18 
    519== 1.7.1 
    6 * bugfix: setup_ssh_keys() - print message and exit if ssh_options[:keys] not set 
     20 
     21* bugfix: setup_ssh_keys() - print message and exit if ssh_options[:keys] not set [Mike Bailey] 
    722 
    823== 1.7.0 
    924 
    10 * new tasks :install_memcached, :memcached_start, :memcached_stop, :memcached_restart [mbailey] 
    11 * set default shell to '/bin/bash' for new users [mbailey] 
    12 * bugfix: set default values for mongrel_user and mongrel_group 
     25* new tasks :install_memcached, :memcached_start, :memcached_stop, :memcached_restart [Mike Bailey] 
     26* set default shell to '/bin/bash' for new users [Mike Bailey] 
     27* bugfix: set default values for mongrel_user and mongrel_group [Mike Bailey] 
    1328 
    1429== 1.6.0 
    1530 
    16 * new task :install_php installs php-5.2.2 [mbailey] 
     31* new task :install_php installs php-5.2.2 [Mike Bailey] 
    1732 
    1833== 1.5.1 
    1934 
    20 * bugfix: fixed bug in su_put that was causing Windows [mbailey] 
     35* bugfix: fixed bug in su_put that was causing Windows [Mike Bailey] 
    2136 
    2237== 1.5.0 
    2338 
    24 * bugfix: :set_perms_for_mongrel_dirs [mbailey] 
     39* bugfix: :set_perms_for_mongrel_dirs [Mike Bailey] 
    2540  - now don't fail if log files do not exist (e.g initial deployment) 
    2641  - is called by :after_symlink task instead of :after_update  
     
    2944 
    3045* updated version from 1.4.x to 1.5.x due to pretty big change made 
    31   in previous version (mongrel no longer running as root) [mbailey] 
     46  in previous version (mongrel no longer running as root) [Mike Bailey] 
    3247 
    3348== 1.4.2 
    3449 
    35 * change: mongrel no longer runs as root for security reasons [mbailey] 
    36 * bugfix: install apache version 2.2.4 as previous version is no longer on their webserver [mbailey] 
    37 * bugfix: fixed install_rubygems so install_rails_stack no longer fails when first run [mbailey] 
     50* change: mongrel no longer runs as root for security reasons [Mike Bailey] 
     51* bugfix: install apache version 2.2.4 as previous version is no longer on their webserver [Mike Bailey] 
     52* bugfix: fixed install_rubygems so install_rails_stack no longer fails when first run [Mike Bailey] 
    3853 
    3954== 1.4.0 
    4055 
    41 * renamed svn commands and made svn_create_repos re-runable [mbailey] 
    42 * bugfix: Wildcard Apache NameVirtualHosts directive used be used just once [mbailey] 
     56* renamed svn commands and made svn_create_repos re-runable [Mike Bailey] 
     57* bugfix: Wildcard Apache NameVirtualHosts directive used be used just once [Mike Bailey] 
    4358 
    4459== 1.3.1 
     
    4863== 1.3.0 
    4964 
    50 * added md5sum checking to deprec.download_src [mbailey] 
    51 * new function: deprec.mkdir(path, mode=0755, group=nil, user=nil) [mbailey] 
    52 * start apache and mongrel on server boot [mbailey] 
    53 * removed deprec_dotfiles script as the Cap code it patches is now in Capistrano source. [mbailey] 
    54 * changed from LGPG to GPL licence. [mbailey] 
     65* added md5sum checking to deprec.download_src [Mike Bailey] 
     66* new function: deprec.mkdir(path, mode=0755, group=nil, user=nil) [Mike Bailey] 
     67* start apache and mongrel on server boot [Mike Bailey] 
     68* removed deprec_dotfiles script as the Cap code it patches is now in Capistrano source. [Mike Bailey] 
     69* changed from LGPG to GPL licence. [Mike Bailey] 
    5570 
    5671== 1.2.2 
    5772 
    58 * Added enable_multiverse(), disable_multiverse() tasks for ubuntu package management [mbailey] 
    59 * Removed termios as a gem requirement as it doesn't work on Windows [mbailey] 
     73* Added enable_multiverse(), disable_multiverse() tasks for ubuntu package management [Mike Bailey] 
     74* Removed termios as a gem requirement as it doesn't work on Windows [Mike Bailey] 
    6075 
    6176== 1.2.1 
    6277 
    63 * Updated railsmachine code to include SSL fix from new release [mbailey] 
     78* Updated railsmachine code to include SSL fix from new release [Mike Bailey] 
    6479 
    6580== 1.2.0 
  • trunk/deprec.gemspec

    r74 r115  
    55SPEC = Gem::Specification.new do |spec| 
    66  spec.name = 'deprec' 
    7   spec.version = '1.7.1
     7  spec.version = '1.9.0
    88  spec.summary = 'deployment recipes for capistrano' 
    99  spec.description = <<-EOF 
  • trunk/docs/README.slicehost

    r73 r115  
    1 == Slicehost extras 
     1== Slicehost specific notes for deprec 
    22 
    3 # A freshly built slice gives you the root account 
    4 # This creates a user account with sudo access 
    5 # The '_as_root' means 'log in as root to do this' 
    6 
    7 export HOSTS=deptest.deprecated.org 
    8 cap setup_admin_account_as_root # XXX echo new username 
    9 cap setup_ssh_keys  # XXX do for others also 
    10 cap install_rails_stack 
    11 cap install_php 
    12 cap setup 
    13 cap deploy_with_migrations 
    14 cap restart_apache 
     3# Slicehost provides you with root login and password for your slice. 
    154 
    16 # svn+trac 
    17 cap install_svn 
    18 cap svn_setup_repos 
     5# Change the root password! 
     6cap change_root_password_as_root # '_as_root' means run this as 'root' user 
    197 
     8# Create an account with sudo access 
     9cap setup_admin_account_as_root  
     10 
     11# Copy your ssh keys to remote server to avoid having to type passwords 
     12cap setup_ssh_keys 
     13 
     14now read README.quickstart 
  • trunk/lib/deprec/capistrano_extensions/deprec_extensions.rb

    r73 r115  
    33 
    44module Deprec 
    5   DEPREC_TEMPLATES_BASE = File.join(File.dirname(__FILE__), '..', 'recipes', 'templates') 
     5  DEPREC_TEMPLATES_BASE = File.join(File.dirname(__FILE__), '..', 'templates') 
    66 
    77  def render_template_to_file(template_name, destination_file_name, templates_dir = DEPREC_TEMPLATES_BASE) 
    8     template_name += '.conf' if File.extname(template_name) == '' 
     8    template_name += '.conf' if File.extname(template_name) == '' # XXX this to be removed 
    99     
    1010    file = File.join(templates_dir, template_name) 
     
    2222    sudo <<-END 
    2323    sh -c ' 
    24       grep "#{value}" #{filename} > /dev/null 2>&1 ||  
     24      grep -F "#{value}" #{filename} > /dev/null 2>&1 ||  
    2525      test ! -f #{filename} || 
    2626      echo "#{value}" >> #{filename} 
  • trunk/lib/deprec/generators/deprec/templates/deploy.rb

    r66 r115  
    1414role :app, domain 
    1515role :db,  domain, :primary => true 
     16role :scm, domain 
    1617 
    1718# ============================================================================= 
     
    3334# Automatically symlink these directories from current/public to shared/public. 
    3435# set :app_symlinks, %w{photo, document, asset} 
     36 
     37# ============================================================================= 
     38# SPECIAL OPTIONS 
     39# ============================================================================= 
     40# These options allow you to tweak deprec behaviour 
     41 
     42# If you do not keep database.yml in source control, set this to false. 
     43# After new code is deployed, deprec will symlink current/config/database.yml  
     44# to shared/config/database.yml 
     45# 
     46# You can generate shared/config/database.yml with 'cap generate_database_yml' 
     47# 
     48# set :database_yml_in_scm, true 
    3549 
    3650# ============================================================================= 
  • trunk/lib/deprec/recipes.rb

    r73 r115  
    11require 'deprec/recipes/ssh' 
    22require 'deprec/recipes/svn' 
     3require 'deprec/recipes/trac' 
     4require 'deprec/recipes/rails' 
    35require 'deprec/recipes/ubuntu' 
     6require 'deprec/recipes/apache' 
     7require 'deprec/recipes/memcache' 
    48require 'deprec/third_party/mongrel_cluster/recipes' 
    59require 'deprec/third_party/vmbuilder/plugins' 
    610require 'deprec/third_party/railsmachine/recipes/apache' 
    711require 'deprec/third_party/railsmachine/recipes/mysql' 
     12require 'deprec/capistrano_extensions/cli_extensions.rb' 
    813require 'deprec/capistrano_extensions/deprec_extensions.rb' 
    914require 'deprec/capistrano_extensions/actor_extensions.rb' 
    1015 
    1116Capistrano.configuration(:must_exist).load do 
    12   set :application, lambda { application = Capistrano::CLI.password_prompt "Enter application name:" } 
     17  set :application, lambda { Capistrano::CLI.prompt "Enter application name" } 
    1318  set :user, (defined?(user) ? user : ENV['USER']) # user who is deploying 
    1419  set :group, 'deploy'           # deployment group 
     
    3136    install_rubygems 
    3237    install_gems  
    33     install_apache 
     38    apache_install 
    3439  end 
    3540   
     
    7176     
    7277    sudo "chgrp -R #{mongrel_group} #{tmp_dir} #{shared_dir}" 
    73     sudo "chmod 0775 #{tmp_dir} #{shared_dir}"  
     78    sudo "chmod -R g+w #{tmp_dir} #{shared_dir}"  
    7479    # set owner and group of mongrels file (if they exist) 
    7580    files.each { |file| 
     
    176181    gem.update_system 
    177182  end 
    178      
    179   task :install_apache do 
    180     version = 'httpd-2.2.4' 
    181     set :src_package, { 
    182       :file => version + '.tar.gz',    
    183       :md5sum => '3add41e0b924d4bb53c2dee55a38c09e  httpd-2.2.4.tar.gz',  
    184       :dir => version,   
    185       :url => "http://www.apache.org/dist/httpd/#{version}.tar.gz", 
    186       :unpack => "tar zxf #{version}.tar.gz;", 
    187       :configure => %w( 
    188         ./configure 
    189         --enable-mods-shared=all 
    190         --enable-proxy  
    191         --enable-proxy-balancer  
    192         --enable-proxy-http  
    193         --enable-rewrite   
    194         --enable-cache  
    195         --enable-headers  
    196         --enable-ssl  
    197         --enable-deflate  
    198         --with-included-apr   #_so_this_recipe_doesn't_break_when_rerun 
    199         --enable-dav          #_for_subversion_ 
    200         --enable-so           #_for_subversion_ 
    201         ; 
    202         ).reject{|arg| arg.match '#'}.join(' '), 
    203       :make => 'make;', 
    204       :install => 'make install;', 
    205       :post_install => 'install -b support/apachectl /etc/init.d/httpd;' 
    206     } 
    207     apt.install( {:base => %w(zlib1g-dev zlib1g openssl libssl-dev)}, :stable ) 
    208     deprec.download_src(src_package, src_dir) 
    209     deprec.install_from_src(src_package, src_dir) 
    210     # ubuntu specific - should instead call generic name which can be picked up by different distros 
    211     send(run_method, "update-rc.d httpd defaults") 
    212   end 
    213    
    214   desc "Install PHP from source" 
    215   task :install_php do 
    216     version = 'php-5.2.2' 
    217     set :src_package, { 
    218       :file => version + '.tar.gz', 
    219       :md5sum => '7a920d0096900b2b962b21dc5c55fe3c  php-5.2.2.tar.gz',  
    220       :dir => version, 
    221       :url => "http://www.php.net/distributions/#{version}.tar.gz", 
    222       :unpack => "tar zxf #{version}.tar.gz;", 
    223       :configure => %w( 
    224         ./configure  
    225         --prefix=/usr/local/php 
    226         --with-apxs2=/usr/local/apache2/bin/apxs 
    227         --disable-ipv6 
    228         --enable-sockets 
    229         --enable-soap 
    230         --with-pcre-regex 
    231         --with-mysql 
    232         --with-zlib  
    233         --with-gettext 
    234         --with-sqlite 
    235         --enable-sqlite-utf8 
    236         --with-openssl 
    237         --with-mcrypt 
    238         --with-ncurses 
    239         --with-jpeg-dir=/usr 
    240         --with-gd 
    241         --with-ctype 
    242         --enable-mbstring 
    243         --with-curl==/usr/lib  
    244         ; 
    245         ).reject{|arg| arg.match '#'}.join(' '), 
    246       :make => 'make;', 
    247       :install => 'make install;', 
    248       :post_install => "" 
    249     } 
    250     apt.install( {:base => %w(zlib1g-dev zlib1g openssl libssl-dev  
    251       flex libcurl3 libcurl3-dev libmcrypt-dev libmysqlclient15-dev libncurses5-dev  
    252       libxml2-dev libjpeg62-dev libpng12-dev)}, :stable ) 
    253     run "export CFLAGS=-O2;" 
    254     deprec.download_src(src_package, src_dir) 
    255     deprec.install_from_src(src_package, src_dir) 
    256     deprec.append_to_file_if_missing('/usr/local/apache2/conf/httpd.conf', 'AddType application/x-httpd-php .php') 
    257   end 
    258    
    259  
    260    
    261   # move all memcache stuff to separate file 
    262   set :memcache_ip, '127.0.0.1' 
    263   set :memcache_port, 11211 
    264   set :memcache_memory, 256 
    265    
    266   # XXX needs thought/work 
    267   task :memcached_start do 
    268     run "memcached -d -m #{memcache_memory} -l #{memcache_ip} -p #{memcache_port}" 
    269   end 
    270    
    271   # XXX needs thought/work 
    272   task :memcached_stop do 
    273     run "killall memcached" 
    274   end 
    275    
    276   # XXX needs thought/work 
    277   task :memcached_restart do 
    278     memcached_stop 
    279     memcached_start 
    280   end 
    281    
    282   task :install_memcached do 
    283     version = 'memcached-1.2.2' 
    284     set :src_package, { 
    285       :file => version + '.tar.gz',    
    286       :md5sum => 'a08851f7fa7b15e92ee6320b7a79c321  memcached-1.2.2.tar.gz',  
    287       :dir => version,   
    288       :url => "http://www.danga.com/memcached/dist/#{version}.tar.gz", 
    289       :unpack => "tar zxf #{version}.tar.gz;", 
    290       :configure => %w{ 
    291         ./configure 
    292         --prefix=/usr/local  
    293         ; 
    294         }.reject{|arg| arg.match '#'}.join(' '), 
    295       :make => 'make;', 
    296       :install => 'make install;', 
    297       :post_install => 'install -b support/apachectl /etc/init.d/httpd;' 
    298     } 
    299     apt.install( {:base => %w(libevent-dev)}, :stable ) 
    300     deprec.download_src(src_package, src_dir) 
    301     deprec.install_from_src(src_package, src_dir) 
    302   end 
    303    
    304183   
    305184  desc "Setup public symlink directories" 
     
    333212      
    334213  task :setup_admin_account do 
    335     user = Capistrano::CLI.password_prompt "Enter userid for new user:"  
     214    user = Capistrano::CLI.prompt "Enter userid for new user"  
    336215    deprec.useradd(user, :shell => '/bin/bash') 
    337216    puts "Setting pasword for new account" 
     
    345224    as_root { setup_admin_account } 
    346225  end  
     226   
     227  desc "Change password for the root account" 
     228  task :change_root_password do 
     229    sudo_with_input("passwd root", /UNIX password/) # ??? how many  versions of the prompt are there? 
     230  end 
     231 
     232  task :change_root_password_as_root do 
     233    as_root { change_root_password } 
     234  end 
    347235 
    348236   
  • trunk/lib/deprec/recipes/svn.rb

    r73 r115  
    11require 'fileutils' 
     2require 'uri' 
    23 
    34Capistrano.configuration(:must_exist).load do 
     
    1011  # however the SVN docs convinced me it's probably overkill. 
    1112  # http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.serverconfig.pathbasedauthz 
     13  # 
    1214  set :scm_group, 'scm' 
    1315   
    14   set :svn_root, '/usr/local/svn' 
     16  # The following values define the svn repository to work with. 
     17  # If any are undefined but :repository is set, we'll extract the  
     18  # necessary values from it, otherwise we'll prompt the user. 
     19  #  
     20  # An example of :repository entries are: 
     21  # 
     22  #   set :repository, 'svn+ssh://scm.deprecated.org/var/svn/deprec/trunk' 
     23  #   set :repository, 'file:///tmp/svn/deprec/trunk' 
     24  # 
     25  # I've only used svn+ssh but it shouldn't be hard to get the file scheme working. 
     26  # 
     27  set (:svn_scheme) do 
     28    repository ? URI.parse(repository).scheme : 'svn+ssh' 
     29  end 
    1530   
     31  set (:scm_host) do 
     32    if repository 
     33      URI.parse(repository).host || 'localhost' 
     34    elsif ENV['HOSTS'] 
     35      svn_host = ENV['HOSTS'] 
     36    else 
     37      Capistrano::CLI.prompt('svn host') 
     38    end 
     39  end 
     40 
     41  # This is the actual path in the svn repos where we'll check our project into 
     42  set (:repos_path) do 
     43    repository ? URI.parse(repository).path : Capistrano::CLI.prompt('svn repos path') 
     44  end 
     45 
     46  # We'll calculate this based on the repos_path. It's used when initializing the repository 
     47  set (:repos_root) do 
     48    (repository ? URI.parse(repository).path : repos_path).sub(/\/(trunk|tags|branches)$/, '') 
     49  end 
    1650   
     51  # account name to perform actions on 
     52  # this is a hack to allow us to optionally pass a variable to tasks  
     53  set (:svn_account) do 
     54    Capistrano::CLI.prompt('account name') 
     55  end 
     56   
     57  # I'd like to be able to construct :repository if it's not explicitly set 
     58  # However we're grabbing values from it in the lines above so it would get a bit recursive 
     59  # set :repository, lambda { "#{svn_scheme}://#{scm_host == 'localhost' ? '/' : user+'@'+scm_host}#{repos_path}" } 
     60   
     61  # XXX requires apache to have already been installed... 
    1762  desc "install Subversion version control system" 
    18   task :install_svn do 
     63  task :svn_install, :roles => :scm do 
    1964    # svn 1.4 server improves on 1.3 and is backwards compatible with 1.3 clients 
    2065    # http://subversion.tigris.org/svn_1.4_releasenotes.html 
     
    2368    # http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.reposadmin.basics.backends 
    2469    # 
    25     version = 'subversion-1.4.3' 
     70    # NOTE: we're bulding the python bindings for trac 
     71    # ./subversion/bindings/swig/INSTALL 
     72    # 
     73    version = 'subversion-1.4.4' 
    2674    set :src_package, { 
    2775      :file => version + '.tar.gz',    
    28       :md5sum => '6b991b63e3e1f69670c9e15708e40176 subversion-1.4.3.tar.gz',  
     76      :md5sum => '702655defa418bab8f683f6268b4fd30  subversion-1.4.4.tar.gz',  
    2977      :dir => version,   
    3078      :url => "http://subversion.tigris.org/downloads/#{version}.tar.gz", 
     
    3684        --with-apr=/usr/local/apache2  
    3785        --with-apr-util=/usr/local/apache2 
     86        PYTHON=/usr/bin/python 
    3887        ; 
    3988        ).reject{|arg| arg.match '#'}.join(' ') , # DRY this up 
    4089      :make => 'make;', 
    41       :install => 'make install;' 
     90      :install => 'make install;', 
     91      :post_install => ' 
     92        make swig-py;  
     93        make install-swig-py; 
     94        echo /usr/local/lib/svn-python > /usr/lib/python2.4/site-packages/subversion.pth; 
     95        ' 
    4296    } 
    43     apt.install( {:base => %w(libneon25 libneon25-dev)}, :stable ) 
     97    enable_universe 
     98    apt.install( {:base => %w(libneon25 libneon25-dev swig python-dev)}, :stable ) 
    4499    deprec.download_src(src_package, src_dir) 
    45100    deprec.install_from_src(src_package, src_dir) 
    46101  end 
    47102   
    48   desc "create a repository and import a project" 
     103  desc "grant a user access to svn repos" 
     104  task :svn_grant_user_access, :roles => :scm do 
     105    deprec.useradd(svn_account) 
     106    deprec.groupadd(scm_group)  
     107    deprec.add_user_to_group(svn_account, scm_group) 
     108  end 
     109   
     110  desc "Create subversion repository and import project into it" 
     111  task :svn_setup, :roles => :scm do  
     112    svn_create_repos 
     113    svn_import 
     114  end 
     115   
     116  task :scm_setup, :roles => :scm do # deprecated 
     117    svn_setup 
     118  end 
     119   
     120  task :svn_import_project, :roles => :scm do # deprecated 
     121    svn_setup 
     122  end 
     123   
     124  desc "Create a subversion repository" 
    49125  task :svn_create_repos, :roles => :scm do 
    50     svn_repos ||= "#{svn_root}/#{application}" 
    51     deprec.groupadd(scm_group)  
    52     deprec.add_user_to_group(user, scm_group) 
    53     deprec.mkdir(svn_root, :mode => '0755') 
    54     deprec.mkdir(svn_repos, :mode => '2775', :group => scm_group) 
    55     sudo "svnadmin verify #{svn_repos} > /dev/null 2>&1 || sudo svnadmin create #{svn_repos}" 
    56     sudo "chmod -R g+w #{svn_repos}" 
     126    set :svn_account, user 
     127    svn_grant_user_access 
     128    deprec.mkdir(repos_root, :mode => '2775', :group => scm_group) 
     129    sudo "svnadmin verify #{repos_root} > /dev/null 2>&1 || sudo svnadmin create #{repos_root}" 
     130    sudo "chmod -R g+w #{repos_root}" 
    57131  end 
    58  
    59   # XXX check through and test the next two [mike] 
    60132   
    61   # from Bradley Taylors RailsMachine gem 
    62   desc "Import code into svn repository." 
    63   task :svn_import  do 
     133  # Adapted from code in Bradley Taylors RailsMachine gem 
     134  desc "Import project into subversion repository." 
     135  task :svn_import, :roles => :scm do  
    64136    new_path = "../#{application}" 
    65137    tags = repository.sub("trunk", "tags") 
     
    76148    system "svn co #{repository} #{application}" 
    77149    Dir.chdir application 
     150    svn_remove_log_and_tmp 
     151    puts "Your repository is: #{repository}"  
     152  end 
     153   
     154  # Lifted from Bradley Taylors RailsMachine gem 
     155  desc "remove and ignore log files and tmp from subversion" 
     156  task :svn_remove_log_and_tmp, :roles => :scm  do 
    78157    puts "removing log directory contents from svn" 
    79158    system "svn remove log/*" 
     
    81160    system "svn propset svn:ignore '*.log' log/" 
    82161    system "svn update log/" 
    83     puts "removing tmp directory from svn" 
    84     system "svn remove tmp/" 
     162    puts "removing contents of tmp sub-directorys from svn" 
     163    system "svn remove tmp/cache/*" 
     164    system "svn remove tmp/pids/*" 
     165    system "svn remove tmp/sessions/*" 
     166    system "svn remove tmp/sockets/*" 
    85167    puts "ignoring tmp directory" 
    86     system "svn propset svn:ignore '*' tmp/" 
    87     system "svn update tmp/" 
    88     puts "committing changes" 
    89     system "svn commit -m 'Removed and ignored log files and tmp'" 
    90     puts "Your repository is: #{repository}"  
    91   end 
    92    
    93   # from Bradley Taylors RailsMachine gem 
    94   desc "remove and ignore log files and tmp from subversion" 
    95   task :svn_remove_log_and_tmp do 
    96     puts "removing log directory contents from svn" 
    97     system "svn remove log/*" 
    98     puts "ignoring log directory" 
    99     system "svn propset svn:ignore '*.log' log/" 
    100     system "svn update log/" 
    101     puts "removing tmp directory from svn" 
    102     system "svn remove tmp/" 
    103     puts "ignoring tmp directory" 
    104     system "svn propset svn:ignore '*' tmp/" 
     168    system "svn propset svn:ignore '*' tmp/cache" 
     169    system "svn propset svn:ignore '*' tmp/pids" 
     170    system "svn propset svn:ignore '*' tmp/sessions" 
     171    system "svn propset svn:ignore '*' tmp/sockets" 
    105172    system "svn update tmp/" 
    106173    puts "committing changes" 
     
    108175  end 
    109176   
    110   desc "Cache svn name and password on the server. Useful for http-based repositories." 
     177  # desc "Cache svn name and password on the server. Useful for http-based repositories." 
    111178  task :svn_cache_credentials do 
    112179    run_with_input "svn list #{repository}" 
    113180  end 
     181   
     182 
     183   
    114184   
    115185  # XXX TODO 
  • trunk/lib/deprec/third_party/railsmachine/recipes/apache.rb

    r45 r115  
    6262  end 
    6363   
     64 
    6465  desc "Restart Apache " 
    65   task :restart_apache, :roles => :web do 
     66  task :apache_restart, :roles => :web do 
     67    restart_apache 
     68  end 
     69   
     70  task :restart_apache, :roles => :web do # deprecated 
    6671    send(run_method, "#{apache_ctl} restart") 
    6772  end 
  • trunk/lib/deprec/third_party/railsmachine/recipes/mysql.rb

    r72 r115  
    66   
    77  def execute(sql, user) 
    8     run "mysql --user=root -p --execute=\"#{sql}\"" do |channel, stream, data| 
     8    user = 'root' 
     9    run "mysql --user=#{user} -p --execute=\"#{sql}\"" do |channel, stream, data| 
    910      handle_mysql_password(user, channel, stream, data) 
    1011    end 
     
    4647    # on_rollback {} 
    4748     
     49    # rails puts "socket: /tmp/mysql.sock" into config/database.yml 
     50    # this is not the location for our ubuntu's mysql socket file 
     51    # so we create this link to make depployment using rails defaults simpler 
     52    sudo "sudo ln -sf /var/run/mysqld/mysqld.sock /tmp/mysql.sock" 
     53     
    4854    set_mysql_admin 
    4955    read_config 
    5056     
    51     sql = "CREATE DATABASE #{db_name};" 
     57    sql = "CREATE DATABASE IF NOT EXISTS #{db_name};" 
    5258    sql += "GRANT ALL PRIVILEGES ON #{db_name}.* TO #{db_user}@localhost IDENTIFIED BY '#{db_password}';"   
    5359    mysql.execute sql, mysql_admin