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.
- data/lib/sumodev_deploy.rb +33 -5
- data/sumodev_deploy.gemspec +1 -1
- metadata +1 -1
data/lib/sumodev_deploy.rb
CHANGED
@@ -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
|
|
data/sumodev_deploy.gemspec
CHANGED