File tree Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 1
1
class DeployKit
2
2
def kit_templates_path
3
- ' __TEMPLATES__'
3
+ "__ENV__/ #{ app_env } / __TEMPLATES__"
4
4
end
5
5
6
6
def kit_configs_path
7
- ' __ENV__'
7
+ " __ENV__/ #{ app_env } /__SETTINGS__"
8
8
end
9
9
10
10
# COMMON PATHS
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ def config
5
5
6
6
def configs_load!
7
7
::Config . load_and_set_settings ( '' )
8
- puts "#{ ::KIT_ROOT } /#{ kit_configs_path } /#{ app_env } / *.yml"
8
+ puts "#{ ::KIT_ROOT } /#{ kit_configs_path } /*.yml"
9
9
10
- Dir [ "#{ ::KIT_ROOT } /#{ kit_configs_path } /#{ app_env } / *.yml" ] . each do |settings_file |
10
+ Dir [ "#{ ::KIT_ROOT } /#{ kit_configs_path } /*.yml" ] . each do |settings_file |
11
11
::Settings . add_source! ( settings_file )
12
12
puts ( 'Settings: LOAD FILE => `' + settings_file + '`' ) . light_cyan
13
13
end
Original file line number Diff line number Diff line change 1
1
class DeployKit
2
2
def template_upload from , to , params = { }
3
- tmpl_file = ::KIT_ROOT + "/#{ kit_templates_path } /#{ app_env } /#{ from } "
4
-
5
- unless File . exist? tmpl_file
6
- return log_output "File: #{ tmpl_file } doesn't exist"
7
- end
8
-
3
+ tmpl_file = ::KIT_ROOT + "/#{ kit_templates_path } /#{ from } "
4
+ return log_output "File: #{ tmpl_file } doesn't exist" unless File . exist? tmpl_file
9
5
namespace = OpenStruct . new ( params . merge ( { kit : self , config : config } ) )
10
- erb = File . read ::KIT_ROOT + "/#{ kit_templates_path } /#{ app_env } /#{ from } "
11
- res = ERB . new ( erb ) . result ( namespace . instance_eval { binding } )
6
+
7
+ erb = File . read tmpl_file
8
+ res = ERB . new ( erb ) . result ( namespace . instance_eval { binding } )
12
9
13
10
log_output ( res )
14
11
You can’t perform that action at this time.
0 commit comments