Changeset 115
- Timestamp:
- 07/01/07 17:07:50 (2 years ago)
- Files:
-
- trunk/CHANGELOG (modified) (3 diffs)
- trunk/deprec.gemspec (modified) (1 diff)
- trunk/docs/README.quickstart (copied) (copied from branches/1-7-stable/docs/README.quickstart)
- trunk/docs/README.slicehost (modified) (1 diff)
- trunk/docs/README.svn_trac (copied) (copied from branches/1-7-stable/docs/README.svn_trac)
- trunk/lib/deprec/capistrano_extensions/cli_extensions.rb (copied) (copied from branches/1-7-stable/lib/deprec/capistrano_extensions/cli_extensions.rb)
- trunk/lib/deprec/capistrano_extensions/deprec_extensions.rb (modified) (2 diffs)
- trunk/lib/deprec/generators/deprec/templates/deploy.rb (modified) (2 diffs)
- trunk/lib/deprec/recipes.rb (modified) (6 diffs)
- trunk/lib/deprec/recipes/apache.rb (copied) (copied from branches/1-7-stable/lib/deprec/recipes/apache.rb)
- trunk/lib/deprec/recipes/memcache.rb (copied) (copied from branches/1-7-stable/lib/deprec/recipes/memcache.rb)
- trunk/lib/deprec/recipes/rails.rb (copied) (copied from branches/1-7-stable/lib/deprec/recipes/rails.rb)
- trunk/lib/deprec/recipes/svn.rb (modified) (7 diffs)
- trunk/lib/deprec/recipes/templates (deleted)
- trunk/lib/deprec/recipes/trac.rb (copied) (copied from branches/1-7-stable/lib/deprec/recipes/trac.rb)
- trunk/lib/deprec/templates (copied) (copied from branches/1-7-stable/lib/deprec/templates)
- trunk/lib/deprec/third_party/railsmachine/recipes/apache.rb (modified) (1 diff)
- trunk/lib/deprec/third_party/railsmachine/recipes/mysql.rb (modified) (2 diffs)
- trunk/lib/deprec/third_party/railsmachine/recipes/svn.rb (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/CHANGELOG
r74 r115 3 3 == SVN 4 4 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 5 19 == 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] 7 22 8 23 == 1.7.0 9 24 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] 13 28 14 29 == 1.6.0 15 30 16 * new task :install_php installs php-5.2.2 [ mbailey]31 * new task :install_php installs php-5.2.2 [Mike Bailey] 17 32 18 33 == 1.5.1 19 34 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] 21 36 22 37 == 1.5.0 23 38 24 * bugfix: :set_perms_for_mongrel_dirs [ mbailey]39 * bugfix: :set_perms_for_mongrel_dirs [Mike Bailey] 25 40 - now don't fail if log files do not exist (e.g initial deployment) 26 41 - is called by :after_symlink task instead of :after_update … … 29 44 30 45 * 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] 32 47 33 48 == 1.4.2 34 49 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] 38 53 39 54 == 1.4.0 40 55 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] 43 58 44 59 == 1.3.1 … … 48 63 == 1.3.0 49 64 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] 55 70 56 71 == 1.2.2 57 72 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] 60 75 61 76 == 1.2.1 62 77 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] 64 79 65 80 == 1.2.0 trunk/deprec.gemspec
r74 r115 5 5 SPEC = Gem::Specification.new do |spec| 6 6 spec.name = 'deprec' 7 spec.version = '1. 7.1'7 spec.version = '1.9.0' 8 8 spec.summary = 'deployment recipes for capistrano' 9 9 spec.description = <<-EOF trunk/docs/README.slicehost
r73 r115 1 == Slicehost extras1 == Slicehost specific notes for deprec 2 2 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. 15 4 16 # svn+trac 17 cap install_svn 18 cap svn_setup_repos 5 # Change the root password! 6 cap change_root_password_as_root # '_as_root' means run this as 'root' user 19 7 8 # Create an account with sudo access 9 cap setup_admin_account_as_root 10 11 # Copy your ssh keys to remote server to avoid having to type passwords 12 cap setup_ssh_keys 13 14 now read README.quickstart trunk/lib/deprec/capistrano_extensions/deprec_extensions.rb
r73 r115 3 3 4 4 module Deprec 5 DEPREC_TEMPLATES_BASE = File.join(File.dirname(__FILE__), '..', ' recipes', 'templates')5 DEPREC_TEMPLATES_BASE = File.join(File.dirname(__FILE__), '..', 'templates') 6 6 7 7 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 9 9 10 10 file = File.join(templates_dir, template_name) … … 22 22 sudo <<-END 23 23 sh -c ' 24 grep "#{value}" #{filename} > /dev/null 2>&1 ||24 grep -F "#{value}" #{filename} > /dev/null 2>&1 || 25 25 test ! -f #{filename} || 26 26 echo "#{value}" >> #{filename} trunk/lib/deprec/generators/deprec/templates/deploy.rb
r66 r115 14 14 role :app, domain 15 15 role :db, domain, :primary => true 16 role :scm, domain 16 17 17 18 # ============================================================================= … … 33 34 # Automatically symlink these directories from current/public to shared/public. 34 35 # 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 35 49 36 50 # ============================================================================= trunk/lib/deprec/recipes.rb
r73 r115 1 1 require 'deprec/recipes/ssh' 2 2 require 'deprec/recipes/svn' 3 require 'deprec/recipes/trac' 4 require 'deprec/recipes/rails' 3 5 require 'deprec/recipes/ubuntu' 6 require 'deprec/recipes/apache' 7 require 'deprec/recipes/memcache' 4 8 require 'deprec/third_party/mongrel_cluster/recipes' 5 9 require 'deprec/third_party/vmbuilder/plugins' 6 10 require 'deprec/third_party/railsmachine/recipes/apache' 7 11 require 'deprec/third_party/railsmachine/recipes/mysql' 12 require 'deprec/capistrano_extensions/cli_extensions.rb' 8 13 require 'deprec/capistrano_extensions/deprec_extensions.rb' 9 14 require 'deprec/capistrano_extensions/actor_extensions.rb' 10 15 11 16 Capistrano.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" } 13 18 set :user, (defined?(user) ? user : ENV['USER']) # user who is deploying 14 19 set :group, 'deploy' # deployment group … … 31 36 install_rubygems 32 37 install_gems 33 install_apache38 apache_install 34 39 end 35 40 … … 71 76 72 77 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}" 74 79 # set owner and group of mongrels file (if they exist) 75 80 files.each { |file| … … 176 181 gem.update_system 177 182 end 178 179 task :install_apache do180 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 ./configure189 --enable-mods-shared=all190 --enable-proxy191 --enable-proxy-balancer192 --enable-proxy-http193 --enable-rewrite194 --enable-cache195 --enable-headers196 --enable-ssl197 --enable-deflate198 --with-included-apr #_so_this_recipe_doesn't_break_when_rerun199 --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 distros211 send(run_method, "update-rc.d httpd defaults")212 end213 214 desc "Install PHP from source"215 task :install_php do216 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 ./configure225 --prefix=/usr/local/php226 --with-apxs2=/usr/local/apache2/bin/apxs227 --disable-ipv6228 --enable-sockets229 --enable-soap230 --with-pcre-regex231 --with-mysql232 --with-zlib233 --with-gettext234 --with-sqlite235 --enable-sqlite-utf8236 --with-openssl237 --with-mcrypt238 --with-ncurses239 --with-jpeg-dir=/usr240 --with-gd241 --with-ctype242 --enable-mbstring243 --with-curl==/usr/lib244 ;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-dev251 flex libcurl3 libcurl3-dev libmcrypt-dev libmysqlclient15-dev libncurses5-dev252 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 end258 259 260 261 # move all memcache stuff to separate file262 set :memcache_ip, '127.0.0.1'263 set :memcache_port, 11211264 set :memcache_memory, 256265 266 # XXX needs thought/work267 task :memcached_start do268 run "memcached -d -m #{memcache_memory} -l #{memcache_ip} -p #{memcache_port}"269 end270 271 # XXX needs thought/work272 task :memcached_stop do273 run "killall memcached"274 end275 276 # XXX needs thought/work277 task :memcached_restart do278 memcached_stop279 memcached_start280 end281 282 task :install_memcached do283 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 ./configure292 --prefix=/usr/local293 ;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 end303 304 183 305 184 desc "Setup public symlink directories" … … 333 212 334 213 task :setup_admin_account do 335 user = Capistrano::CLI.p assword_prompt "Enter userid for new user:"214 user = Capistrano::CLI.prompt "Enter userid for new user" 336 215 deprec.useradd(user, :shell => '/bin/bash') 337 216 puts "Setting pasword for new account" … … 345 224 as_root { setup_admin_account } 346 225 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 347 235 348 236 trunk/lib/deprec/recipes/svn.rb
r73 r115 1 1 require 'fileutils' 2 require 'uri' 2 3 3 4 Capistrano.configuration(:must_exist).load do … … 10 11 # however the SVN docs convinced me it's probably overkill. 11 12 # http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.serverconfig.pathbasedauthz 13 # 12 14 set :scm_group, 'scm' 13 15 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 15 30 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 16 50 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... 17 62 desc "install Subversion version control system" 18 task : install_svndo63 task :svn_install, :roles => :scm do 19 64 # svn 1.4 server improves on 1.3 and is backwards compatible with 1.3 clients 20 65 # http://subversion.tigris.org/svn_1.4_releasenotes.html … … 23 68 # http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.reposadmin.basics.backends 24 69 # 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' 26 74 set :src_package, { 27 75 :file => version + '.tar.gz', 28 :md5sum => ' 6b991b63e3e1f69670c9e15708e40176 subversion-1.4.3.tar.gz',76 :md5sum => '702655defa418bab8f683f6268b4fd30 subversion-1.4.4.tar.gz', 29 77 :dir => version, 30 78 :url => "http://subversion.tigris.org/downloads/#{version}.tar.gz", … … 36 84 --with-apr=/usr/local/apache2 37 85 --with-apr-util=/usr/local/apache2 86 PYTHON=/usr/bin/python 38 87 ; 39 88 ).reject{|arg| arg.match '#'}.join(' ') , # DRY this up 40 89 :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 ' 42 96 } 43 apt.install( {:base => %w(libneon25 libneon25-dev)}, :stable ) 97 enable_universe 98 apt.install( {:base => %w(libneon25 libneon25-dev swig python-dev)}, :stable ) 44 99 deprec.download_src(src_package, src_dir) 45 100 deprec.install_from_src(src_package, src_dir) 46 101 end 47 102 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" 49 125 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}" 57 131 end 58 59 # XXX check through and test the next two [mike]60 132 61 # fromBradley Taylors RailsMachine gem62 desc "Import code into svn repository."63 task :svn_import do133 # Adapted from code in Bradley Taylors RailsMachine gem 134 desc "Import project into subversion repository." 135 task :svn_import, :roles => :scm do 64 136 new_path = "../#{application}" 65 137 tags = repository.sub("trunk", "tags") … … 76 148 system "svn co #{repository} #{application}" 77 149 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 78 157 puts "removing log directory contents from svn" 79 158 system "svn remove log/*" … … 81 160 system "svn propset svn:ignore '*.log' log/" 82 161 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/*" 85 167 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" 105 172 system "svn update tmp/" 106 173 puts "committing changes" … … 108 175 end 109 176 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." 111 178 task :svn_cache_credentials do 112 179 run_with_input "svn list #{repository}" 113 180 end 181 182 183 114 184 115 185 # XXX TODO trunk/lib/deprec/third_party/railsmachine/recipes/apache.rb
r45 r115 62 62 end 63 63 64 64 65 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 66 71 send(run_method, "#{apache_ctl} restart") 67 72 end trunk/lib/deprec/third_party/railsmachine/recipes/mysql.rb
r72 r115 6 6 7 7 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| 9 10 handle_mysql_password(user, channel, stream, data) 10 11 end … … 46 47 # on_rollback {} 47 48 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 48 54 set_mysql_admin 49 55 read_config 50 56 51 sql = "CREATE DATABASE #{db_name};"57 sql = "CREATE DATABASE IF NOT EXISTS #{db_name};" 52 58 sql += "GRANT ALL PRIVILEGES ON #{db_name}.* TO #{db_user}@localhost IDENTIFIED BY '#{db_password}';" 53 59 mysql.execute sql, mysql_admin
