luban 0.6.9 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/luban/deployment/cli/application/worker.rb +4 -0
- data/lib/luban/deployment/cli/package/worker.rb +1 -2
- data/lib/luban/deployment/cli/service/controller.rb +5 -5
- data/lib/luban/deployment/cli/service/worker.rb +8 -0
- data/lib/luban/deployment/helpers/configuration.rb +4 -2
- data/lib/luban/deployment/parameters.rb +2 -0
- data/lib/luban/deployment/templates/application/config/deploy/__stage/env_vars.rb +3 -0
- data/lib/luban/deployment/templates/envrc.erb +6 -1
- data/lib/luban/deployment/templates/project/.gitignore +1 -0
- data/lib/luban/deployment/templates/unset_envrc.erb +3 -0
- data/lib/luban/deployment/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e6d4f9cdf3011d2178e45db658af31c0c177bd3
|
4
|
+
data.tar.gz: 601049ece4a58b0b23cb368cc343009723ac887d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13b3bdc0260bbb588b730136cd682a51df4c5a3a91efeca7ea9d9cf6084942e1975f7975b1a879a31f916909e39239977de6cd14efd7bc586ed44c5bdb1b909a
|
7
|
+
data.tar.gz: ae4f6b0794889d7eafbb073b34ad2fa842681f64ac99c12aeed7e45102a335bdb1fbdd9a84b69433e7d5d0694a95a949c3390bbf30e53166340948e45290c76c
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ module Luban
|
|
5
5
|
include Luban::Deployment::Worker::Paths::Remote
|
6
6
|
include Luban::Deployment::Service::Worker::Base
|
7
7
|
|
8
|
+
def shell_setup_commands
|
9
|
+
super << "cd #{release_path}"
|
10
|
+
end
|
11
|
+
|
8
12
|
%i(name full_name version major_version patch_level).each do |method|
|
9
13
|
define_method("application_#{method}") { send("target_#{method}") }
|
10
14
|
end
|
@@ -186,11 +186,11 @@ module Luban
|
|
186
186
|
end
|
187
187
|
|
188
188
|
def start_process!
|
189
|
-
capture(
|
189
|
+
capture(compose_command(start_command))
|
190
190
|
end
|
191
191
|
|
192
192
|
def stop_process!
|
193
|
-
capture(
|
193
|
+
capture(compose_command(stop_command))
|
194
194
|
end
|
195
195
|
|
196
196
|
def check_process!
|
@@ -229,15 +229,15 @@ module Luban
|
|
229
229
|
end
|
230
230
|
|
231
231
|
def monitor_process!
|
232
|
-
test(
|
232
|
+
test(compose_command(monitor_command))
|
233
233
|
end
|
234
234
|
|
235
235
|
def unmonitor_process!
|
236
|
-
test(
|
236
|
+
test(compose_command(unmonitor_command))
|
237
237
|
end
|
238
238
|
|
239
239
|
def reload_monitor_process!
|
240
|
-
test(
|
240
|
+
test(compose_command(reload_monitor_command))
|
241
241
|
end
|
242
242
|
end
|
243
243
|
|
@@ -3,6 +3,14 @@ module Luban
|
|
3
3
|
module Service
|
4
4
|
class Worker < Luban::Deployment::Package::Worker
|
5
5
|
module Base
|
6
|
+
def shell_setup_commands
|
7
|
+
@shell_setup_commands ||= ["source #{envrc_file}"]
|
8
|
+
end
|
9
|
+
|
10
|
+
def compose_command(cmd)
|
11
|
+
"#{shell_setup_commands.join('; ')}; #{cmd} 2>&1"
|
12
|
+
end
|
13
|
+
|
6
14
|
%i(name full_name version major_version patch_level).each do |method|
|
7
15
|
define_method("service_#{method}") { send("target_#{method}") }
|
8
16
|
end
|
@@ -161,8 +161,10 @@ module Luban
|
|
161
161
|
def load_stage_configuration
|
162
162
|
target.load_configuration_file(stage_config_file)
|
163
163
|
if File.directory?(stage_config_path)
|
164
|
-
|
165
|
-
|
164
|
+
["*.rb", "{packages}/**/*.rb"].each do |pattern|
|
165
|
+
Dir[stage_config_path.join(pattern)].each do |file|
|
166
|
+
target.load_configuration_file(file)
|
167
|
+
end
|
166
168
|
end
|
167
169
|
end
|
168
170
|
end
|
@@ -25,6 +25,7 @@ module Luban
|
|
25
25
|
|
26
26
|
parameter :stages
|
27
27
|
parameter :applications
|
28
|
+
parameter :env_vars
|
28
29
|
|
29
30
|
parameter :work_dir
|
30
31
|
parameter :apps_path
|
@@ -37,6 +38,7 @@ module Luban
|
|
37
38
|
def set_default_general_parameters
|
38
39
|
set_default :luban_roles, %i(app)
|
39
40
|
set_default :luban_root_path, DefaultLubanRootPath
|
41
|
+
set_default :env_vars, {}
|
40
42
|
set_default :user, ENV['USER']
|
41
43
|
set_default :config_finder, {}
|
42
44
|
end
|
@@ -22,6 +22,11 @@ else
|
|
22
22
|
PATH="$LUBAN_ROOT/bin:$PATH"
|
23
23
|
export LUBAN_ROOT
|
24
24
|
export PATH
|
25
|
-
|
25
|
+
<%- env_vars.each_pair do |name, value| -%>
|
26
|
+
<%= name.upcase %>=<%= value.inspect %>
|
27
|
+
<%- end -%>
|
28
|
+
<%- env_vars.each_key do |name| -%>
|
29
|
+
export <%= name.upcase %>
|
30
|
+
<%- end -%>
|
26
31
|
echo_line "Environment <%= env_name %> is activated!"
|
27
32
|
fi
|
@@ -11,6 +11,9 @@ if [ -n "${LUBAN_ROOT:+x}" ]; then
|
|
11
11
|
PATH=${PATH//$LUBAN_ROOT\/bin:/}
|
12
12
|
unset LUBAN_ROOT
|
13
13
|
export PATH
|
14
|
+
<%- env_vars.each_key do |name| -%>
|
15
|
+
unset <%= name.upcase %>
|
16
|
+
<%- end -%>
|
14
17
|
echo_line "Environment <%= env_name %> is de-activated!"
|
15
18
|
else
|
16
19
|
local current_env=${LUBAN_ROOT##*env/}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luban
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rubyist Lei
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: luban-cli
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- lib/luban/deployment/runner.rb
|
150
150
|
- lib/luban/deployment/templates/application/config/deploy.rb.erb
|
151
151
|
- lib/luban/deployment/templates/application/config/deploy/__stage.rb.erb
|
152
|
+
- lib/luban/deployment/templates/application/config/deploy/__stage/env_vars.rb
|
152
153
|
- lib/luban/deployment/templates/application/config/deploy/__stage/packages/.gitkeep
|
153
154
|
- lib/luban/deployment/templates/application/config/deploy/__stage/profile/.gitkeep
|
154
155
|
- lib/luban/deployment/templates/application/config/deploy/__stage/templates/.gitkeep
|