crushserver 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
+ :build:
3
4
  :minor: 3
4
- :patch: 0
5
+ :patch: 1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{crushserver}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["PJ Kelly", "Mason Browne"]
@@ -1,101 +1,102 @@
1
1
  require 'tinder'
2
+ Capistrano::Configuration.instance(:must_exist).load do
3
+ namespace :sync do
4
+ desc "Sync both database and attachments to local machine. Requires awesome-backup plugin."
5
+ task :all do
6
+ sync.db
7
+ sync.attachments
8
+ end
2
9
 
3
- namespace :sync do
4
- desc "Sync both database and attachments to local machine. Requires awesome-backup plugin."
5
- task :all do
6
- sync.db
7
- sync.attachments
8
- end
10
+ desc "Sync database to local computer. Requires awesome-backup plugin."
11
+ task :db do
12
+ backup.mirror
13
+ end
9
14
 
10
- desc "Sync database to local computer. Requires awesome-backup plugin."
11
- task :db do
12
- backup.mirror
15
+ desc "Copy attachments from server."
16
+ task :attachments, :roles => :app, :only => { :primary => true } do
17
+ FileUtils.mkdir_p "public/system"
18
+ # While we could use the following command...
19
+ # download("#{shared_path}/system", "public/system", :recursive => true)
20
+ # let's use rsync instead so we only download what we need...
21
+ system "rsync --delete --recursive --times --rsh=ssh --compress --human-readable --progress #{user}@#{domain}:#{shared_path}/system/ public/system/"
22
+ end
13
23
  end
14
24
 
15
- desc "Copy attachments from server."
16
- task :attachments, :roles => :app, :only => { :primary => true } do
17
- FileUtils.mkdir_p "public/system"
18
- # While we could use the following command...
19
- # download("#{shared_path}/system", "public/system", :recursive => true)
20
- # let's use rsync instead so we only download what we need...
21
- system "rsync --delete --recursive --times --rsh=ssh --compress --human-readable --progress #{user}@#{domain}:#{shared_path}/system/ public/system/"
22
- end
23
- end
25
+ namespace(:db) do
26
+ desc "Execute db:populate rake task in appropriate environment"
27
+ task :populate, :roles => :app, :only => { :primary => true } do
28
+ run "cd #{current_path}; rake RAILS_ENV=#{rails_env} db:populate"
29
+ end
24
30
 
25
- namespace(:db) do
26
- desc "Execute db:populate rake task in appropriate environment"
27
- task :populate, :roles => :app, :only => { :primary => true } do
28
- run "cd #{current_path}; rake RAILS_ENV=#{rails_env} db:populate"
29
- end
31
+ desc "Execute db:seed rake task in appropriate environment"
32
+ task :seed, :roles => :app, :only => { :primary => true } do
33
+ run "cd #{current_path}; rake RAILS_ENV=#{rails_env} db:seed"
34
+ end
30
35
 
31
- desc "Execute db:seed rake task in appropriate environment"
32
- task :seed, :roles => :app, :only => { :primary => true } do
33
- run "cd #{current_path}; rake RAILS_ENV=#{rails_env} db:seed"
36
+ desc "Execute db:seed_fu rake task in appropriate environment"
37
+ task :seed_fu, :roles => :app, :only => { :primary => true } do
38
+ run "cd #{current_path}; rake RAILS_ENV=#{rails_env} db:seed_fu"
39
+ end
34
40
  end
35
41
 
36
- desc "Execute db:seed_fu rake task in appropriate environment"
37
- task :seed_fu, :roles => :app, :only => { :primary => true } do
38
- run "cd #{current_path}; rake RAILS_ENV=#{rails_env} db:seed_fu"
42
+ namespace(:asset) do
43
+ namespace(:packager) do
44
+ desc "Execute asset:packager:build_all rake task in appropriate environment"
45
+ task :build_all, :roles => :app do
46
+ run "cd #{latest_release}; rake RAILS_ENV=#{rails_env} asset:packager:build_all"
47
+ end
48
+
49
+ desc "Execute asset:packager:delete_all rake task in appropriate environment"
50
+ task :delete_all, :roles => :app do
51
+ run "cd #{latest_release}; rake RAILS_ENV=#{rails_env} asset:packager:delete_all"
52
+ end
53
+ end
39
54
  end
40
- end
41
55
 
42
- namespace(:asset) do
43
- namespace(:packager) do
44
- desc "Execute asset:packager:build_all rake task in appropriate environment"
45
- task :build_all, :roles => :app do
46
- run "cd #{latest_release}; rake RAILS_ENV=#{rails_env} asset:packager:build_all"
56
+ namespace :campfire do
57
+ desc "Send a message to the campfire chat room"
58
+ task :snitch do
59
+ if ENV['CAMPFIRE_SUBDOMAIN'].blank? || ENV['CAMPFIRE_TOKEN'].blank? || ENV['CAMPFIRE_ROOM'].blank?
60
+ puts "Campfire notifications are not configured in your environment. The CAMPFIRE_SUBDOMAIN, CAMPFIRE_TOKEN and CAMPFIRE_ROOM environment variables must be set."
61
+ else
62
+ campfire = Tinder::Campfire.new ENV['CAMPFIRE_SUBDOMAIN'], :ssl => true, :token => ENV['CAMPFIRE_TOKEN']
63
+ room = campfire.find_room_by_name ENV['CAMPFIRE_ROOM']
64
+ snitch_message = fetch(:snitch_message) { ENV['MESSAGE'] || abort('Capfire snitch message is missing. Use set :snitch_message, "Your message"') }
65
+ room.speak(snitch_message)
66
+ end
47
67
  end
48
68
 
49
- desc "Execute asset:packager:delete_all rake task in appropriate environment"
50
- task :delete_all, :roles => :app do
51
- run "cd #{latest_release}; rake RAILS_ENV=#{rails_env} asset:packager:delete_all"
69
+ # desc "Send a message to the campfire chat room about the deploy start"
70
+ # task :snitch_begin do
71
+ # set :snitch_message, "BEGIN DEPLOY [#{stage.to_s.upcase}]: #{ENV['USER']}, #{branch}/#{real_revision[0, 7]} to #{deploy_to}"
72
+ # snitch
73
+ # end
74
+
75
+ desc "Send a message to the campfire chat room about the deploy end"
76
+ task :snitch_end do
77
+ # set :snitch_message, "END DEPLOY [#{stage.to_s.upcase}]: #{ENV['USER']}, #{branch}/#{real_revision[0, 7]} to #{deploy_to}"
78
+ set :snitch_message, "#{application.upcase} was deployed to #{stage.to_s.upcase} by #{ENV['USER'].upcase} (#{branch}/#{real_revision[0, 7]})"
79
+ snitch
52
80
  end
53
- end
54
- end
55
81
 
56
- namespace :campfire do
57
- desc "Send a message to the campfire chat room"
58
- task :snitch do
59
- if ENV['CAMPFIRE_SUBDOMAIN'].blank? || ENV['CAMPFIRE_TOKEN'].blank? || ENV['CAMPFIRE_ROOM'].blank?
60
- puts "Campfire notifications are not configured in your environment. The CAMPFIRE_SUBDOMAIN, CAMPFIRE_TOKEN and CAMPFIRE_ROOM environment variables must be set."
61
- else
62
- campfire = Tinder::Campfire.new ENV['CAMPFIRE_SUBDOMAIN'], :ssl => true, :token => ENV['CAMPFIRE_TOKEN']
63
- room = campfire.find_room_by_name ENV['CAMPFIRE_ROOM']
64
- snitch_message = fetch(:snitch_message) { ENV['MESSAGE'] || abort('Capfire snitch message is missing. Use set :snitch_message, "Your message"') }
65
- room.speak(snitch_message)
66
- end
82
+ # desc "Send a message to the campfire chat roob about the rollback"
83
+ # task :snitch_rollback do
84
+ # set :snitch_message, "ROLLBACK [#{stage.to_s.upcase}]: #{ENV['USER']}, #{latest_revision[0, 7]} to #{previous_revision[0, 7]} on #{deploy_to}"
85
+ # snitch
86
+ # end
67
87
  end
68
88
 
69
- # desc "Send a message to the campfire chat room about the deploy start"
70
- # task :snitch_begin do
71
- # set :snitch_message, "BEGIN DEPLOY [#{stage.to_s.upcase}]: #{ENV['USER']}, #{branch}/#{real_revision[0, 7]} to #{deploy_to}"
72
- # snitch
73
- # end
89
+ #############################################################
90
+ # Hooks
91
+ #############################################################
74
92
 
75
- desc "Send a message to the campfire chat room about the deploy end"
76
- task :snitch_end do
77
- # set :snitch_message, "END DEPLOY [#{stage.to_s.upcase}]: #{ENV['USER']}, #{branch}/#{real_revision[0, 7]} to #{deploy_to}"
78
- set :snitch_message, "#{application.upcase} was deployed to #{stage.to_s.upcase} by #{ENV['USER'].upcase} (#{branch}/#{real_revision[0, 7]})"
79
- snitch
80
- end
81
-
82
- # desc "Send a message to the campfire chat roob about the rollback"
83
- # task :snitch_rollback do
84
- # set :snitch_message, "ROLLBACK [#{stage.to_s.upcase}]: #{ENV['USER']}, #{latest_revision[0, 7]} to #{previous_revision[0, 7]} on #{deploy_to}"
85
- # snitch
93
+ # before :deploy do
94
+ # campfire.snitch_begin unless ENV['QUIET'].to_i > 0
86
95
  # end
87
- end
88
-
89
- #############################################################
90
- # Hooks
91
- #############################################################
92
96
 
93
- # before :deploy do
94
- # campfire.snitch_begin unless ENV['QUIET'].to_i > 0
95
- # end
96
-
97
- after :deploy do
98
- campfire.snitch_end unless ENV['QUIET'].to_i > 0
99
- end
97
+ after :deploy do
98
+ campfire.snitch_end unless ENV['QUIET'].to_i > 0
99
+ end
100
100
 
101
- # before 'deploy:rollback', 'campfire:snitch_rollback'
101
+ # before 'deploy:rollback', 'campfire:snitch_rollback'
102
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - PJ Kelly