biola_deploy 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module BiolaDeploy
2
- VERSION = '0.1.0'
3
- end
2
+ VERSION = '0.2.0'
3
+ end
@@ -99,7 +99,7 @@ location #{app_url.path} {
99
99
  password = db_config['password']
100
100
 
101
101
  client.query 'USE mysql'
102
- client.query "CREATE DATABASE #{db}"
102
+ client.query "CREATE DATABASE IF NOT EXISTS #{db}"
103
103
  client.query "GRANT ALL PRIVILEGES ON #{db}.* TO '#{user}'@'%' IDENTIFIED BY '#{password}'"
104
104
  end
105
105
  end
@@ -142,11 +142,25 @@ location #{app_url.path} {
142
142
  end
143
143
  end
144
144
 
145
+ desc 'Tell NewRelic about this deployment'
146
+ task :tell_newrelic => :environment do
147
+ require 'new_relic/command'
148
+ require 'new_relic/commands/deployments'
149
+
150
+ version = if defined? Version
151
+ Version.current
152
+ else
153
+ `git log -1 --format=%h`.chomp # abbreviated hash of latest git commit
154
+ end
155
+
156
+ NewRelic::Command::Deployments.new :revision => version
157
+ end
158
+
145
159
  desc 'Run all setup tasks'
146
160
  task :post_setup => [:create_db, :create_user, :prepare_logs, :prepare_tmp, :prepare_public, :setup_webserver, :setup_solr]
147
161
 
148
162
  desc 'Run all deployment tasks'
149
- task :post_deploy => [:migrate_db, :reindex_solr, :precompile_assets, :restart_app]
163
+ task :post_deploy => [:migrate_db, :reindex_solr, :precompile_assets, :tell_newrelic, :restart_app]
150
164
 
151
165
  private
152
166
  def web_root_dir
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biola_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: whiskey_disk
16
- requirement: &78832420 !ruby/object:Gem::Requirement
16
+ requirement: &71291250 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.6.24
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *78832420
24
+ version_requirements: *71291250
25
25
  description: Designed to automate deployment of Biola's applications to it's servers
26
26
  using whiskey_disk friendly rake tasks
27
27
  email: adam.crownoble@biola.edu