trooper 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/trooper/action.rb +13 -6
- data/lib/trooper/actions/default_action.rb +7 -0
- data/lib/trooper/actions/precompile_assets_action.rb +20 -0
- data/lib/trooper/config/action.rb +4 -1
- data/lib/trooper/host.rb +1 -1
- data/lib/trooper/version.rb +1 -1
- metadata +16 -15
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Trooper comes with some built in actions that you can use in your own strategies
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
1. Super easy! `gem install trooper` or add it to your Gemfile `gem "trooper", "~> 0.6
|
9
|
+
1. Super easy! `gem install trooper` or add it to your Gemfile `gem "trooper", "~> 0.6"`
|
10
10
|
2. Pop into your terminal and run `=> trooper init`
|
11
11
|
3. Start building you deployment strategy :)
|
12
12
|
|
data/lib/trooper/action.rb
CHANGED
@@ -8,8 +8,8 @@ module Trooper
|
|
8
8
|
include Trooper::DSL::Rake
|
9
9
|
include Trooper::DSL::Bundler
|
10
10
|
|
11
|
-
attr_reader :name, :description, :
|
12
|
-
attr_accessor :commands
|
11
|
+
attr_reader :name, :description, :block, :options
|
12
|
+
attr_accessor :config, :commands
|
13
13
|
|
14
14
|
# Public: Define a new action.
|
15
15
|
#
|
@@ -43,7 +43,7 @@ module Trooper
|
|
43
43
|
@config = configuration
|
44
44
|
@call_count += 1
|
45
45
|
|
46
|
-
if continue_call?
|
46
|
+
if everything_ok? && continue_call?
|
47
47
|
reset_commands!
|
48
48
|
|
49
49
|
build_commands
|
@@ -70,16 +70,23 @@ module Trooper
|
|
70
70
|
"touch #{prerequisite_list}; if grep -vz #{self.name} #{prerequisite_list}; then #{original_commands.join(' && ')}; else echo 'Already Done'; fi"
|
71
71
|
end
|
72
72
|
|
73
|
-
# Public: Validates the action object.
|
73
|
+
# Public: Validates the action object.
|
74
74
|
#
|
75
75
|
# Examples
|
76
76
|
#
|
77
77
|
# @action.ok? # => true
|
78
78
|
#
|
79
|
-
# Returns true.
|
79
|
+
# Returns true or raise an InvalidActionError exception.
|
80
80
|
def ok?
|
81
|
-
|
81
|
+
begin
|
82
|
+
build_commands
|
83
|
+
reset_commands!
|
84
|
+
true
|
85
|
+
rescue Exception => e
|
86
|
+
raise InvalidActionError, "Action missing config variables - #{e.message}"
|
87
|
+
end
|
82
88
|
end
|
89
|
+
alias :everything_ok? :ok?
|
83
90
|
|
84
91
|
# Public: What type of action this is.
|
85
92
|
#
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'trooper/actions/default_action'
|
2
|
+
|
3
|
+
module Trooper
|
4
|
+
module Actions
|
5
|
+
|
6
|
+
class PrecompileAssetsAction < DefaultAction
|
7
|
+
name :precompile_assets
|
8
|
+
description "Precompile Application Assets"
|
9
|
+
options :local => true, :on => :first_host
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def build_commands
|
14
|
+
run "bundle exec rake assets:precompile RAILS_ENV=production RAILS_GROUPS=assets"
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -9,6 +9,7 @@ require 'trooper/actions/rollback_migrate_action'
|
|
9
9
|
require 'trooper/actions/setup_database_action'
|
10
10
|
require 'trooper/actions/setup_trooper_action'
|
11
11
|
require 'trooper/actions/update_repository_action'
|
12
|
+
require 'trooper/actions/precompile_assets_action'
|
12
13
|
|
13
14
|
module Trooper
|
14
15
|
module Config
|
@@ -18,10 +19,12 @@ module Trooper
|
|
18
19
|
Actions::CloneRepositoryAction, Actions::InstallGemsAction,
|
19
20
|
Actions::MigrateDatabaseAction, Actions::RestartServerAction,
|
20
21
|
Actions::RollbackMigrateAction, Actions::SetupDatabaseAction,
|
21
|
-
Actions::UpdateRepositoryAction]
|
22
|
+
Actions::UpdateRepositoryAction, Actions::PrecompileAssetsAction]
|
22
23
|
|
23
24
|
def action(name, description = "No Description", options = {}, &block)
|
24
25
|
action = Trooper::Action.new name, description, options, &block
|
26
|
+
action.config = self
|
27
|
+
|
25
28
|
Trooper::Arsenal.actions.add action
|
26
29
|
end
|
27
30
|
|
data/lib/trooper/host.rb
CHANGED
data/lib/trooper/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trooper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-ssh
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 2.
|
21
|
+
version: 2.5.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 2.
|
29
|
+
version: 2.5.2
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rspec
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: '2.
|
37
|
+
version: '2.11'
|
38
38
|
type: :development
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: '2.
|
45
|
+
version: '2.11'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: guard-rspec
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '1.2'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.2'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rb-fsevent
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: '0.
|
85
|
+
version: '0.8'
|
86
86
|
type: :development
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '0.
|
93
|
+
version: '0.8'
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: pry
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +130,7 @@ dependencies:
|
|
130
130
|
requirements:
|
131
131
|
- - ~>
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.
|
133
|
+
version: 0.6.4
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version: 0.
|
141
|
+
version: 0.6.4
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
143
|
name: rake
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,6 +169,7 @@ files:
|
|
169
169
|
- lib/trooper/actions/default_action.rb
|
170
170
|
- lib/trooper/actions/install_gems_action.rb
|
171
171
|
- lib/trooper/actions/migrate_database_action.rb
|
172
|
+
- lib/trooper/actions/precompile_assets_action.rb
|
172
173
|
- lib/trooper/actions/prepare_prerequisite_action.rb
|
173
174
|
- lib/trooper/actions/restart_server_action.rb
|
174
175
|
- lib/trooper/actions/rollback_migrate_action.rb
|
@@ -195,7 +196,7 @@ files:
|
|
195
196
|
- LICENSE
|
196
197
|
- Rakefile
|
197
198
|
- README.md
|
198
|
-
homepage:
|
199
|
+
homepage: http://madwire.github.com/trooper
|
199
200
|
licenses:
|
200
201
|
- MIT
|
201
202
|
post_install_message:
|
@@ -210,7 +211,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
210
211
|
version: '0'
|
211
212
|
segments:
|
212
213
|
- 0
|
213
|
-
hash:
|
214
|
+
hash: 370573009495457313
|
214
215
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
216
|
none: false
|
216
217
|
requirements:
|
@@ -219,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
220
|
version: '0'
|
220
221
|
segments:
|
221
222
|
- 0
|
222
|
-
hash:
|
223
|
+
hash: 370573009495457313
|
223
224
|
requirements: []
|
224
225
|
rubyforge_project:
|
225
226
|
rubygems_version: 1.8.24
|