lib/kameleon/cli.rb in kameleon-builder-2.10.10 vs lib/kameleon/cli.rb in kameleon-builder-2.10.11
- old
+ new
@@ -317,25 +317,10 @@
end
recipes_dag.output( :"#{format}" => options[:file] )
Kameleon.ui.info("Generated GraphViz #{format} file: #{options[:file]}")
end
- desc "dryrun <RECIPE_PATH>", "Show the steps the build would process"
- method_option :global, :type => :hash,
- :default => {}, :aliases => "-g",
- :desc => "Set custom global variables"
- method_option :relative, :type => :boolean,
- :default => false,
- :desc => "Make pathnames relative to the current working directory"
- def dryrun(*recipe_paths)
- raise ArgumentError if recipe_paths.empty?
- recipe_paths.each do |path|
- recipe = Kameleon::Recipe.new(path)
- Kameleon::Engine.new(recipe, options.dup.merge({no_create_build_dir: true}).freeze).dryrun
- end
- end
-
desc "export <RECIPE_PATH> <EXPORT_PATH>", "Export the given recipe with its steps and data to a given directory"
method_option :global, :type => :hash,
:default => {}, :aliases => "-g",
:desc => "Set custom global variables"
method_option :add, :type => :boolean,
@@ -382,23 +367,35 @@
:default => nil, :aliases => "-b",
:desc => "Set the build directory path"
method_option :clean, :type => :boolean,
:default => false,
:desc => "Run the command `kameleon clean` first"
- method_option :from_checkpoint, :type => :string,
+ method_option :dryrun, :type => :boolean, :aliases => "-d",
+ :default => false,
+ :desc => "Dry run, only show what would run"
+ method_option :relative, :type => :boolean,
+ :default => false,
+ :desc => "Make dryrun show pathnames relative to the current working directory"
+ method_option :from_checkpoint, :type => :string, :aliases => "-F",
:default => nil,
- :desc => "Restart a build from a specific checkpoint, instead of the latest one"
+ :desc => "Restart the build from a specific checkpointed step, instead of the latest one"
+ method_option :begin_checkpoint, :type => :string, :aliases => "-B",
+ :default => nil,
+ :desc => "Only create checkpoints after the given step"
+ method_option :end_checkpoint, :type => :string, :aliases => "-E",
+ :default => nil,
+ :desc => "Do not create checkpoints after the given step"
method_option :enable_checkpointing, :type => :boolean, :aliases => "-c",
:default => false,
:desc => "Enable creating and using checkpoints"
method_option :microstep_checkpoints, :type => :string,
:enum => ["first", "all"],
:default => "all",
:desc => "Create checkpoint of the first microstep only, or all"
method_option :list_checkpoints, :type => :boolean, :aliases => "-l",
:default => false,
- :desc => "List all availables checkpoints"
+ :desc => "List availables checkpoints"
method_option :enable_cache, :type => :boolean, :aliases => "-C",
:default => false,
:desc => "Generate a persistent cache for the appliance"
method_option :cache_path, :type => :string,
:default => nil,
@@ -434,10 +431,12 @@
@cache.cache_path = options[:from_cache]
recipe_path = @cache.get_recipe
end
raise BuildError, "A recipe file or a persistent cache archive " \
"is required to run this command." if recipe_path.nil?
- if options[:clean]
+ if options[:dryrun]
+ Kameleon::Engine.new(Kameleon::Recipe.new(recipe_path), options.dup.merge({no_create_build_dir: true}).freeze).dryrun
+ elsif options[:clean]
opts = Hash.new.merge options
opts[:lazyload] = false
opts[:fail_silently] = true
engine = Kameleon::Engine.new(Recipe.new(recipe_path), opts)
engine.clean(:with_checkpoint => true)