aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-09-23 15:04:22 -0700
committerelijah <elijah@riseup.net>2014-09-23 15:04:22 -0700
commitbf6c804a7ed36043d6f43c1e38172b11ed50160a (patch)
tree9fe113498613b21705665a8c55b6600f27126791 /lib
parentbe87d1e2039c4f552bef28c4c2749ec72cff3545 (diff)
downloadleap_cli-bf6c804a7ed36043d6f43c1e38172b11ed50160a.tar.gz
leap_cli-bf6c804a7ed36043d6f43c1e38172b11ed50160a.tar.bz2
leap compile - allow optional ENVIRONMENT argument
Diffstat (limited to 'lib')
-rw-r--r--lib/leap_cli/commands/compile.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/compile.rb b/lib/leap_cli/commands/compile.rb
index 63c2047..eaedfbf 100644
--- a/lib/leap_cli/commands/compile.rb
+++ b/lib/leap_cli/commands/compile.rb
@@ -5,9 +5,15 @@ module LeapCli
desc "Compile generated files."
command :compile do |c|
c.desc 'Compiles node configuration files into hiera files used for deployment.'
+ c.arg_name 'ENVIRONMENT', :optional => true
c.command :all do |all|
all.action do |global_options,options,args|
- compile_hiera_files
+ environment = args.first
+ if environment && manager.environment_names.include?(environment)
+ compile_hiera_files(manager.filter(args))
+ else
+ compile_hiera_files
+ end
end
end