rebuy_deployment 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rebuy_deployment/deploy.rb +31 -2
  2. metadata +8 -8
@@ -51,12 +51,41 @@ namespace :deploy do
51
51
  end
52
52
 
53
53
  task :restart, :roles => :app do
54
- run "#{try_sudo} /usr/bin/svc -d /service/category-service"
55
- run "#{try_sudo} /usr/bin/svc -u /service/category-service"
54
+ unless exists?(:restart_type)
55
+ set :restart_type, 'php-fpm'
56
+ end
57
+
58
+ case "#{restart_type}"
59
+ when "php-fpm"
60
+ run "#{try_sudo} /etc/init.d/php-fpm reload"
61
+ when "svc"
62
+ if exists?(:svc_name)
63
+ run "#{try_sudo} /usr/bin/svc -d /service/#{svc_name}"
64
+ run "#{try_sudo} /usr/bin/svc -u /service/#{svc_name}"
65
+ else
66
+ run "#{try_sudo} /usr/bin/svc -d /service/#{application}"
67
+ run "#{try_sudo} /usr/bin/svc -u /service/#{application}"
68
+ end
69
+ end
70
+ end
71
+
72
+ task :new_relic, :roles => :web, :on_error => :continue do
73
+ if exists?(:new_relic_api_key)
74
+ logMsg = `git log -n 1 --format=oneline`
75
+
76
+ run "curl -H 'x-api-key:#{new_relic_api_key}'
77
+ -d 'deployment[app_name]=#{application}'
78
+ -d 'deployment[description]=deployed using capistrano'
79
+ -d 'deployment[changelog]=#{logMsg}'
80
+ -d 'deployment[user]=deployment' https://api.newrelic.com/deployments.xml"
81
+ else
82
+ logger.info "Skipping New Relic deployment because no api key is present."
83
+ end
56
84
  end
57
85
  end
58
86
 
59
87
  after 'deploy:finalize_update', 'deploy:symlink_shared'
60
88
  after 'deploy:finalize_update', 'deploy:change_owner'
61
89
  after 'deploy:symlink', 'deploy:restart'
90
+ after 'deploy:symlink', 'deploy:new_relic'
62
91
  after 'deploy:setup', 'deploy:prepare_directory_structure'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rebuy_deployment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-22 00:00:00.000000000 Z
12
+ date: 2012-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
- requirement: &14848820 !ruby/object:Gem::Requirement
16
+ requirement: &16732980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -24,10 +24,10 @@ dependencies:
24
24
  version: 2.12.0
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *14848820
27
+ version_requirements: *16732980
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: capistrano-ext
30
- requirement: &14847180 !ruby/object:Gem::Requirement
30
+ requirement: &16731340 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ! '>='
@@ -35,10 +35,10 @@ dependencies:
35
35
  version: '0'
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *14847180
38
+ version_requirements: *16731340
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: rake
41
- requirement: &14846540 !ruby/object:Gem::Requirement
41
+ requirement: &16730700 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ! '>='
@@ -46,7 +46,7 @@ dependencies:
46
46
  version: '0'
47
47
  type: :runtime
48
48
  prerelease: false
49
- version_requirements: *14846540
49
+ version_requirements: *16730700
50
50
  description: This gem offers deployment for all rebuy.de projects
51
51
  email:
52
52
  - m.roetgers@rebuy.de