sumodev_deploy 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@ configuration.load do
32
32
  role(:web) { web_servers }
33
33
  role(:db, :primary => true) { db_server }
34
34
 
35
- after 'deploy', 'deploy:cleanup'
35
+ after 'deploy', 'deploy:cleanup', 'sumodev:errbit:after_deploy'
36
36
 
37
37
  namespace :sumodev do
38
38
  namespace :db do
@@ -40,7 +40,7 @@ configuration.load do
40
40
  task :create, :roles => :db do
41
41
  run "create_db #{db_name}"
42
42
  end
43
-
43
+
44
44
  desc "Dump the remote database, and outputs the content so you can pipe it"
45
45
  task :dump, :roles => :db do
46
46
  run "mysqldump --set-charset #{db_name}" do |ch, stream, out|
@@ -87,7 +87,35 @@ configuration.load do
87
87
  }
88
88
  end
89
89
  end
90
-
90
+
91
+ namespace :errbit do
92
+ task :after_deploy, :rolse => :app do
93
+ update_api_key
94
+ notify
95
+ end
96
+ desc "Updates the Errbit API key"
97
+ task :update_api_key, :roles => :app do
98
+ next if fetch(:production_errbit_api_key, "").empty?
99
+ run "if [ -f #{shared_path}/config/library/globals.php ]; then sed -i \"s/define('ERRBIT_API_KEY', '.*');/define('ERRBIT_API_KEY', '#{production_errbit_api_key}');/\" #{shared_path}/config/library/globals.php; fi"
100
+ end
101
+ desc "Notify Errbit about a dqeploy"
102
+ task :notify, :roles => :app do
103
+ next if fetch(:production_errbit_api_key, "").empty?
104
+ require 'active_support/core_ext/object'
105
+
106
+ parameters = {
107
+ :api_key => production_errbit_api_key,
108
+ :deploy => {
109
+ :rails_env => stage,
110
+ :local_username => ENV["USER"],
111
+ :scm_repository => repository,
112
+ :scm_revision => current_revision
113
+ }
114
+ }
115
+ run_locally "curl -d '#{parameters.to_query}' https://errors.sumocoders.be/deploys.txt"
116
+ end
117
+ end
118
+
91
119
  namespace :files do
92
120
  def find_folder_in_parents(folder)
93
121
  require 'pathname'
@@ -142,7 +170,7 @@ configuration.load do
142
170
  end
143
171
  end
144
172
  end
145
-
173
+
146
174
  namespace :redirect do
147
175
  desc "Installs the redirect page for the site"
148
176
  task :put, :roles => :app do
@@ -154,7 +182,7 @@ configuration.load do
154
182
 
155
183
  run %{
156
184
  mkdir -p #{shared_path}/redirect &&
157
- wget --quiet -O #{shared_path}/redirect/index.php http://static.sumocoders.be/redirect/index.phps &&
185
+ wget --quiet -O #{shared_path}/redirect/index.php http://static.sumocoders.be/redirect/index.phps &&
158
186
  wget --quiet -O #{shared_path}/redirect/.htaccess http://static.sumocoders.be/redirect/htaccess
159
187
  }
160
188
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "sumodev_deploy"
5
- s.version = "0.2.5"
5
+ s.version = "0.2.6"
6
6
 
7
7
  s.authors = ["Jan De Poorter"]
8
8
  s.date = "2012-04-18"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sumodev_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: