crossroads_capistrano 1.4.35 → 1.4.36

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "crossroads_capistrano"
6
- s.version = "1.4.35"
6
+ s.version = "1.4.36"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Steve Kenworthy", "Ben Tillman", "Nathan Broadbent"]
9
9
  s.email = ["it_dept@crossroads.org.hk"]
@@ -10,7 +10,7 @@ load File.join(File.dirname(__FILE__), "config.rb")
10
10
 
11
11
  # Settings
12
12
  # ---------------------------------------------------------
13
- set :default_stage, "preview"
13
+ set :default_stage, "staging"
14
14
  set :rails_env, "production"
15
15
 
16
16
  set :scm, :git
@@ -33,7 +33,7 @@ def needs_ssh_key?; repository.include?("github.com"); end
33
33
 
34
34
  # Hooks
35
35
  # ---------------------------------------------------------
36
- before "deploy:symlink", "deploy:symlink_config"
36
+ after "deploy:update_code", "deploy:symlink_config"
37
37
  after "deploy:restart", "deploy:cleanup"
38
38
 
39
39
  # Deployment tasks that need an after hook to notify hoptoad/newrelic/etc.
@@ -16,6 +16,7 @@ namespace :rvm do
16
16
  desc "Trust the application rvmrc file that is deployed"
17
17
  task :trust do
18
18
  run "rvm rvmrc trust #{current_path}"
19
+ run "if [ -d #{release_path} ]; then rvm rvmrc trust #{release_path}; fi"
19
20
  end
20
21
 
21
22
  end
@@ -0,0 +1,27 @@
1
+ #
2
+ # Capistrano recipe to generate a self-signed ssl certificate
3
+ #
4
+ # Requires :site_domain_name be defined.
5
+ #
6
+ # It also "sets us up the bomb"
7
+ #
8
+
9
+ require File.join(File.dirname(__FILE__), 'yum.rb')
10
+
11
+ namespace :ssl do
12
+
13
+ desc "Generates a self-signed ssl certificate."
14
+ task :generate do
15
+ install_deps
16
+ sudo "openssl genrsa -out /etc/pki/tls/private/#{site_domain_name}.key 2048"
17
+ sudo "chown root:root /etc/pki/tls/private/#{site_domain_name}.key && chmod 640 /etc/pki/tls/private/#{site_domain_name}.key"
18
+ sudo "openssl req -batch -new -key /etc/pki/tls/private/#{site_domain_name}.key -out /etc/pki/tls/certs/#{site_domain_name}.csr"
19
+ sudo "openssl x509 -req -days 365 -in /etc/pki/tls/certs/#{site_domain_name}.csr -signkey /etc/pki/tls/private/#{site_domain_name}.key -out /etc/pki/tls/certs/#{site_domain_name}.crt"
20
+ sudo "rm -f /etc/pki/tls/certs/#{site_domain_name}.csr"
21
+ end
22
+
23
+ task :install_deps do
24
+ yum.install( {:base => %w(openssl openssl-devel)}, :stable )
25
+ end
26
+
27
+ end
@@ -3,5 +3,5 @@
3
3
  #
4
4
  require 'whenever/capistrano'
5
5
 
6
+ set :whenever_environment, defer { stage.to_s.gsub('live','production') }
6
7
  set :whenever_command, "bundle exec whenever" if fetch(:bundler, true)
7
-
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crossroads_capistrano
3
3
  version: !ruby/object:Gem::Version
4
- hash: 65
4
+ hash: 79
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 35
10
- version: 1.4.35
9
+ - 36
10
+ version: 1.4.36
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steve Kenworthy
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-08-30 00:00:00 Z
20
+ date: 2011-09-03 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: capistrano
@@ -115,6 +115,7 @@ files:
115
115
  - lib/crossroads_capistrano/recipes/postgresql.rb
116
116
  - lib/crossroads_capistrano/recipes/revisions.rb
117
117
  - lib/crossroads_capistrano/recipes/rvm.rb
118
+ - lib/crossroads_capistrano/recipes/ssl.rb
118
119
  - lib/crossroads_capistrano/recipes/stack.rb
119
120
  - lib/crossroads_capistrano/recipes/thinking_sphinx.rb
120
121
  - lib/crossroads_capistrano/recipes/user_permissions.rb