capistrano-ash 0.0.5 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  * Defined default stages and set the :default_stage variable to "staging"
4
4
  * Added an example Capfile for deploying Zend or Zend/Doctrine applications
5
-
5
+ * Added the default deploy_to file path and set our backup_to variable
6
6
 
7
7
  == 0.0.4 (December 7, 2010)
8
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.11
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{capistrano-ash}
8
- s.version = "0.0.5"
8
+ s.version = "0.0.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["August Ash"]
data/lib/ash/base.rb CHANGED
@@ -1,12 +1,8 @@
1
- # set default stages
2
- set :stages, %w(staging production)
3
- set :default_stge, "staging"
4
-
5
1
  # Required gems/libraries
6
2
  require 'rubygems'
7
3
  require 'railsless-deploy'
8
- require 'capistrano/ext/multistage'
9
4
  require 'ash/common'
5
+ require 'capistrano/ext/multistage'
10
6
 
11
7
  configuration = Capistrano::Configuration.respond_to?(:instance) ?
12
8
  Capistrano::Configuration.instance(:must_exist) :
@@ -14,39 +10,42 @@ configuration = Capistrano::Configuration.respond_to?(:instance) ?
14
10
 
15
11
  configuration.load do
16
12
 
17
- # --------------------------------------------
18
- # Setting defaults
19
- # --------------------------------------------
20
- set :copy_exclude, [".svn", ".DS_Store", "*.sample", "LICENSE*", "Capfile", "config"]
21
- set :deploy_via, :remote_cache
22
- set :group_writable, false
23
- set :use_sudo, false
24
- set :scm, :subversion
25
- set :scm_verbose, true
26
-
27
- # show password requests on windows (http://weblog.jamisbuck.org/2007/10/14/capistrano-2-1)
28
- default_run_options[:pty] = true
29
-
30
- # --------------------------------------------
31
- # Ash methods
32
- # --------------------------------------------
33
- namespace :ash do
13
+ # set default stages
14
+ set :stages, %w(staging production)
15
+ set :default_stge, "staging"
16
+
17
+ # --------------------------------------------
18
+ # Setting defaults
19
+ # --------------------------------------------
20
+ set :copy_exclude, [".svn", ".DS_Store", "*.sample", "LICENSE*", "Capfile", "config", "REVISION"]
21
+ set :deploy_via, :remote_cache
22
+ set :group_writable, false
23
+ set :use_sudo, false
24
+ set :scm, :subversion
25
+ set :scm_verbose, true
26
+
27
+ # show password requests on windows (http://weblog.jamisbuck.org/2007/10/14/capistrano-2-1)
28
+ default_run_options[:pty] = true
29
+
30
+ # --------------------------------------------
31
+ # Ash methods
32
+ # --------------------------------------------
33
+ namespace :ash do
34
34
  desc "Fix the permissions on Ash servers"
35
35
  task :fixperms, :except => { :no_release => true } do
36
- # chmod the files and directories.
37
- run "find #{latest_release} -type d -exec chmod 755 {} \\;"
38
- run "find #{latest_release} -type f -exec chmod 644 {} \\;"
36
+ # chmod the files and directories.
37
+ run "find #{latest_release} -type d -exec chmod 755 {} \\;"
38
+ run "find #{latest_release} -type f -exec chmod 644 {} \\;"
39
39
  end
40
40
 
41
41
  desc "Task for to test that Capistrano is working"
42
42
  task :uname do
43
- run "uname -a"
43
+ run "uname -a"
44
44
  end
45
45
 
46
46
  desc "Print environment of Capistrano user"
47
47
  task :getpath do
48
- run "echo $PATH"
48
+ run "echo $PATH"
49
49
  end
50
- end
51
-
52
- end
50
+ end
51
+ end
@@ -6,6 +6,14 @@ configuration = Capistrano::Configuration.respond_to?(:instance) ?
6
6
  Capistrano.configuration(:must_exist)
7
7
 
8
8
  configuration.load do
9
+ # --------------------------------------------
10
+ # Set some defaults
11
+ # --------------------------------------------
12
+ # Deploy to file path
13
+ set(:deploy_to) { "/var/www/#{application}/#{stage}" }
14
+
15
+ # Define your backups directory
16
+ set(:backup_to) { "#{deploy_to}/backups/" }
9
17
 
10
18
  # --------------------------------------------
11
19
  # Calling our Methods
@@ -13,7 +21,6 @@ configuration.load do
13
21
  after "deploy:setup", "deploy:setup_shared"
14
22
  after "deploy:finalize_update", "ash:fixperms"
15
23
  after "deploy:symlink", "zend:symlink"
16
- after "zend:symlink", "zend:set_environment"
17
24
  after "deploy", "deploy:cleanup"
18
25
 
19
26
  # --------------------------------------------
@@ -43,15 +50,17 @@ configuration.load do
43
50
  task :symlink, :except => { :no_release => true } do
44
51
  run "ln -nfs #{shared_path}/var #{current_release}/var"
45
52
  run "ln -nfs #{shared_path}/system #{current_release}/public/system"
46
- run "mv #{latest_release}/application/configs/application.ini.dist #{latest_release}/application/configs/application.ini"
47
- run "mv #{latest_release}/public/htaccess.#{stage} #{latest_release}/public/.htaccess"
48
- run "cp #{latest_release}/scripts/doctrine-cli.#{stage} #{latest_release}/scripts/doctrine-cli"
49
- sudo "chmod +x #{latest_release}/scripts/doctrine-cli"
50
- end
51
-
52
- desc "Set proper environment variable in scripts"
53
- task :set_environment, :roles => :web do
54
- run "perl -pi -e 's/production/#{stage}/' #{latest_release}/application/Application.php"
53
+ run "mv #{current_release}/application/configs/application.ini.dist #{current_release}/application/configs/application.ini"
54
+ run "ln -nfs #{current_release}/application/Application.#{stage}.php #{current_release}/application/Application.php"
55
+ run "mv #{current_release}/public/htaccess.#{stage} #{current_release}/public/.htaccess"
56
+ run "cp #{current_release}/scripts/doctrine-cli.#{stage} #{current_release}/scripts/doctrine-cli"
57
+ sudo "chmod +x #{current_release}/scripts/doctrine-cli"
58
+
59
+ # remove the example or other environment example files
60
+ run "rm -f #{current_release}/scripts/doctrine-cli.dist"
61
+ run "rm -f #{current_release}/scripts/doctrine-cli.staging"
62
+ run "rm -f #{current_release}/scripts/doctrine-cli.production"
63
+ run "rm -f #{current_release}/application/Application.example.php"
55
64
  end
56
65
  end
57
66
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 5
9
- version: 0.0.5
8
+ - 11
9
+ version: 0.0.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - August Ash