crushserver 0.2.2 → 0.3.0
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.
- data/.gitignore +2 -0
- data/Rakefile +1 -0
- data/VERSION +1 -0
- data/VERSION.yml +2 -2
- data/crushserver.gemspec +48 -0
- data/lib/crushserver/recipes.rb +84 -62
- metadata +34 -8
data/.gitignore
ADDED
data/Rakefile
CHANGED
@@ -7,6 +7,7 @@ begin
|
|
7
7
|
gemspec.authors = ['PJ Kelly', 'Mason Browne']
|
8
8
|
gemspec.email = 'pj@crushlovely.com'
|
9
9
|
gemspec.homepage = 'http://github.com/crushlovely/crushserver'
|
10
|
+
gemspec.add_dependency "tinder", ">= 1.4.0"
|
10
11
|
end
|
11
12
|
rescue LoadError
|
12
13
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.3.0
|
data/VERSION.yml
CHANGED
data/crushserver.gemspec
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{crushserver}
|
8
|
+
s.version = "0.3.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["PJ Kelly", "Mason Browne"]
|
12
|
+
s.date = %q{2010-06-23}
|
13
|
+
s.description = %q{A collection of capistrano tasks frequently used at Crush + Lovely.}
|
14
|
+
s.email = %q{pj@crushlovely.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".gitignore",
|
21
|
+
"LICENSE",
|
22
|
+
"README",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"VERSION.yml",
|
26
|
+
"crushserver.gemspec",
|
27
|
+
"lib/crushserver/recipes.rb"
|
28
|
+
]
|
29
|
+
s.homepage = %q{http://github.com/crushlovely/crushserver}
|
30
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
s.rubygems_version = %q{1.3.7}
|
33
|
+
s.summary = %q{A collection of capistrano tasks frequently used at Crush + Lovely.}
|
34
|
+
|
35
|
+
if s.respond_to? :specification_version then
|
36
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
37
|
+
s.specification_version = 3
|
38
|
+
|
39
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
40
|
+
s.add_runtime_dependency(%q<tinder>, [">= 1.4.0"])
|
41
|
+
else
|
42
|
+
s.add_dependency(%q<tinder>, [">= 1.4.0"])
|
43
|
+
end
|
44
|
+
else
|
45
|
+
s.add_dependency(%q<tinder>, [">= 1.4.0"])
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
data/lib/crushserver/recipes.rb
CHANGED
@@ -1,79 +1,101 @@
|
|
1
|
-
|
1
|
+
require 'tinder'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
desc "Sync database to local computer. Requires awesome-backup plugin."
|
11
|
-
task :db do
|
12
|
-
backup.mirror
|
13
|
-
end
|
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
|
14
9
|
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
10
|
+
desc "Sync database to local computer. Requires awesome-backup plugin."
|
11
|
+
task :db do
|
12
|
+
backup.mirror
|
23
13
|
end
|
24
14
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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
|
30
24
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
35
30
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
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"
|
40
34
|
end
|
41
35
|
|
42
|
-
|
43
|
-
|
44
|
-
|
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
|
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"
|
54
39
|
end
|
40
|
+
end
|
55
41
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
desc "copy shared configurations to new release. this task should be called after deploy:update_code like so: after 'deploy:update_code', 'bdg:localize:copy_shared_configurations'"
|
62
|
-
task :copy_shared_configurations, :roles => [:app] do
|
63
|
-
config_files.each do |f|
|
64
|
-
run "ln -nsf #{shared_path}/config/#{f} #{release_path}/config/#{f}"
|
65
|
-
end
|
66
|
-
end
|
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"
|
67
47
|
end
|
68
48
|
|
69
|
-
desc "
|
70
|
-
task :
|
71
|
-
|
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"
|
72
52
|
end
|
53
|
+
end
|
54
|
+
end
|
73
55
|
|
74
|
-
|
75
|
-
|
76
|
-
|
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)
|
77
66
|
end
|
78
67
|
end
|
68
|
+
|
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
|
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
|
86
|
+
# end
|
87
|
+
end
|
88
|
+
|
89
|
+
#############################################################
|
90
|
+
# Hooks
|
91
|
+
#############################################################
|
92
|
+
|
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
|
79
99
|
end
|
100
|
+
|
101
|
+
# before 'deploy:rollback', 'campfire:snitch_rollback'
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crushserver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
version: 0.3.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- PJ Kelly
|
@@ -10,10 +15,24 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date:
|
18
|
+
date: 2010-06-23 00:00:00 -07:00
|
14
19
|
default_executable:
|
15
|
-
dependencies:
|
16
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: tinder
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 4
|
32
|
+
- 0
|
33
|
+
version: 1.4.0
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
17
36
|
description: A collection of capistrano tasks frequently used at Crush + Lovely.
|
18
37
|
email: pj@crushlovely.com
|
19
38
|
executables: []
|
@@ -24,11 +43,14 @@ extra_rdoc_files:
|
|
24
43
|
- LICENSE
|
25
44
|
- README
|
26
45
|
files:
|
46
|
+
- .gitignore
|
27
47
|
- LICENSE
|
48
|
+
- README
|
28
49
|
- Rakefile
|
50
|
+
- VERSION
|
29
51
|
- VERSION.yml
|
52
|
+
- crushserver.gemspec
|
30
53
|
- lib/crushserver/recipes.rb
|
31
|
-
- README
|
32
54
|
has_rdoc: true
|
33
55
|
homepage: http://github.com/crushlovely/crushserver
|
34
56
|
licenses: []
|
@@ -39,21 +61,25 @@ rdoc_options:
|
|
39
61
|
require_paths:
|
40
62
|
- lib
|
41
63
|
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
42
65
|
requirements:
|
43
66
|
- - ">="
|
44
67
|
- !ruby/object:Gem::Version
|
68
|
+
segments:
|
69
|
+
- 0
|
45
70
|
version: "0"
|
46
|
-
version:
|
47
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
48
73
|
requirements:
|
49
74
|
- - ">="
|
50
75
|
- !ruby/object:Gem::Version
|
76
|
+
segments:
|
77
|
+
- 0
|
51
78
|
version: "0"
|
52
|
-
version:
|
53
79
|
requirements: []
|
54
80
|
|
55
81
|
rubyforge_project:
|
56
|
-
rubygems_version: 1.3.
|
82
|
+
rubygems_version: 1.3.7
|
57
83
|
signing_key:
|
58
84
|
specification_version: 3
|
59
85
|
summary: A collection of capistrano tasks frequently used at Crush + Lovely.
|