capistrano-ash 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc ADDED
@@ -0,0 +1,9 @@
1
+ == 0.0.5 (December 8, 2010)
2
+
3
+ * Defined default stages and set the :default_stage variable to "staging"
4
+ * Added an example Capfile for deploying Zend or Zend/Doctrine applications
5
+
6
+
7
+ == 0.0.4 (December 7, 2010)
8
+
9
+ * Added dependencies to the the gemspec
data/README.textile CHANGED
@@ -1,5 +1,67 @@
1
+ h2. Deploying Drupal example
2
+
1
3
  The capistrano/ash/drupal library takes a hash of Drupal multisites in the following format.
2
4
 
3
5
  @set :multisites, {"default" => "mysite.com", "another" => "another.mysite.com"}@
4
6
 
5
- where each key is a folder in your @sites@ directory and each value is the URL of the multisite. If you are not using multisites, just exclude the @:multisites@ variable definition.
7
+ where each key is a folder in your @sites@ directory and each value is the URL of the multisite. If you are not using multisites, just exclude the @:multisites@ variable definition.
8
+
9
+ h2. Deploying Zend or Zend/Doctrine example
10
+
11
+ <pre>
12
+ <code>
13
+ # Capfile
14
+ load 'deploy' if respond_to?(:namespace) # cap2 differentiator
15
+
16
+ # Define available stages
17
+ set :stages, %w(staging production)
18
+ set :default_stage, "staging"
19
+
20
+ # --------------------------------------------
21
+ # Define required Gems/libraries
22
+ # --------------------------------------------
23
+ require 'ash/zend_doctrine'
24
+
25
+ # --------------------------------------------
26
+ # Setting defaults
27
+ # --------------------------------------------
28
+ # IP-address or host's servername
29
+ role :app, "bestappever.com"
30
+ role :web, "bestappever.com"
31
+ role :db, "bestappever.com", :primary => true
32
+
33
+ # Application settings.
34
+ set :application, "best_app_ever"
35
+
36
+ # VCS information.
37
+ set :repository, "https://svn.example.com/REPO/trunk"
38
+ set :scm_username, "SVN_USER"
39
+ set :scm_password, proc{Capistrano::CLI.password_prompt("Subversion password for '#{scm_username}':")}
40
+
41
+ # SSH login credentials
42
+ set :user, "SSH_USER"
43
+ set :password, proc{Capistrano::CLI.password_prompt("SSH password for '#{user}':")}
44
+
45
+ # --------------------------------------------
46
+ # Calling our Methods
47
+ # --------------------------------------------
48
+ after "deploy:setup_shared", "app:setup_shared"
49
+ after "zend:symlink", "app:symlink"
50
+
51
+ # --------------------------------------------
52
+ # Application Specific Custom Methods
53
+ # --------------------------------------------
54
+ namespace :app do
55
+ desc "Setup shared directories and permissions specific to the application"
56
+ task :setup_shared, :roles => :web, :except => { :no_release => true } do
57
+ run "mkdir -p #{shared_path}/media"
58
+ sudo "chmod -R 777 #{shared_path}/*"
59
+ end
60
+
61
+ desc "Symlink shared directories specific to the application"
62
+ task :symlink, :except => { :no_release => true } do
63
+ run "ln -nfs #{shared_path}/media #{current_release}/public/media"
64
+ end
65
+ end
66
+ </code>
67
+ </pre>
data/Rakefile CHANGED
@@ -1,8 +1,11 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
1
4
  begin
2
5
  require 'jeweler'
3
6
  Jeweler::Tasks.new do |gemspec|
4
7
  gemspec.name = "capistrano-ash"
5
- gemspec.summary = "August Ash recipes for Capistrano"
8
+ gemspec.summary = "Useful task libraries for August Ash recipes for Capistrano"
6
9
  gemspec.description = "August Ash recipes for Capistrano"
7
10
  gemspec.email = "jake@augustash.com"
8
11
  gemspec.homepage = "https://github.com/augustash/capistrano-ash"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.5
@@ -5,29 +5,31 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{capistrano-ash}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.5"
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"]
12
- s.date = %q{2010-12-06}
12
+ s.date = %q{2010-12-08}
13
13
  s.description = %q{August Ash recipes for Capistrano}
14
14
  s.email = %q{jake@augustash.com}
15
15
  s.extra_rdoc_files = [
16
16
  "README.textile"
17
17
  ]
18
18
  s.files = [
19
+ "CHANGELOG.rdoc",
19
20
  "README.textile",
20
21
  "Rakefile",
21
22
  "VERSION",
22
23
  "capistrano-ash.gemspec",
23
24
  "lib/ash/base.rb",
24
25
  "lib/ash/common.rb",
25
- "lib/ash/drupal.rb"
26
+ "lib/ash/drupal.rb",
27
+ "lib/ash/zend_doctrine.rb"
26
28
  ]
27
29
  s.homepage = %q{https://github.com/augustash/capistrano-ash}
28
30
  s.require_paths = ["lib"]
29
31
  s.rubygems_version = %q{1.3.7}
30
- s.summary = %q{August Ash recipes for Capistrano}
32
+ s.summary = %q{Useful task libraries for August Ash recipes for Capistrano}
31
33
 
32
34
  if s.respond_to? :specification_version then
33
35
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
data/lib/ash/base.rb CHANGED
@@ -1,3 +1,7 @@
1
+ # set default stages
2
+ set :stages, %w(staging production)
3
+ set :default_stge, "staging"
4
+
1
5
  # Required gems/libraries
2
6
  require 'rubygems'
3
7
  require 'railsless-deploy'
@@ -0,0 +1,58 @@
1
+ # Require our base library.
2
+ require 'ash/base'
3
+
4
+ configuration = Capistrano::Configuration.respond_to?(:instance) ?
5
+ Capistrano::Configuration.instance(:must_exist) :
6
+ Capistrano.configuration(:must_exist)
7
+
8
+ configuration.load do
9
+
10
+ # --------------------------------------------
11
+ # Calling our Methods
12
+ # --------------------------------------------
13
+ after "deploy:setup", "deploy:setup_shared"
14
+ after "deploy:finalize_update", "ash:fixperms"
15
+ after "deploy:symlink", "zend:symlink"
16
+ after "zend:symlink", "zend:set_environment"
17
+ after "deploy", "deploy:cleanup"
18
+
19
+ # --------------------------------------------
20
+ # Overloaded Methods
21
+ # --------------------------------------------
22
+ namespace :deploy do
23
+ desc "Setup shared directories and permissions after initial setup"
24
+ task :setup_shared, :roles => :web, :except => { :no_release => true } do
25
+ run "mkdir -p #{shared_path}/var"
26
+ run "mkdir -p #{shared_path}/var/logs"
27
+ run "mkdir -p #{shared_path}/var/cache"
28
+ run "mkdir -p #{shared_path}/var/sessions"
29
+ run "mkdir -p #{shared_path}/system"
30
+ sudo "chmod -R 777 #{shared_path}/*"
31
+ end
32
+
33
+ desc "[internal] Touches up the released code. This is called by update_code after the basic deploy finishes."
34
+ task :finalize_update, :roles => :web, :except => { :no_release => true } do
35
+ # remove shared directories
36
+ run "rm -Rf #{latest_release}/var"
37
+ run "rm -Rf #{latest_release}/public/system"
38
+ end
39
+ end
40
+
41
+ namespace :zend do
42
+ desc "Symlink shared directories"
43
+ task :symlink, :except => { :no_release => true } do
44
+ run "ln -nfs #{shared_path}/var #{current_release}/var"
45
+ 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"
55
+ end
56
+ end
57
+
58
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - August Ash
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-06 00:00:00 -06:00
17
+ date: 2010-12-08 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -27,6 +27,7 @@ extensions: []
27
27
  extra_rdoc_files:
28
28
  - README.textile
29
29
  files:
30
+ - CHANGELOG.rdoc
30
31
  - README.textile
31
32
  - Rakefile
32
33
  - VERSION
@@ -34,6 +35,7 @@ files:
34
35
  - lib/ash/base.rb
35
36
  - lib/ash/common.rb
36
37
  - lib/ash/drupal.rb
38
+ - lib/ash/zend_doctrine.rb
37
39
  has_rdoc: true
38
40
  homepage: https://github.com/augustash/capistrano-ash
39
41
  licenses: []
@@ -65,6 +67,6 @@ rubyforge_project:
65
67
  rubygems_version: 1.3.7
66
68
  signing_key:
67
69
  specification_version: 3
68
- summary: August Ash recipes for Capistrano
70
+ summary: Useful task libraries for August Ash recipes for Capistrano
69
71
  test_files: []
70
72