lib/vidar/cli.rb in vidar-1.9.3 vs lib/vidar/cli.rb in vidar-1.9.4

- old
+ new

@@ -40,15 +40,21 @@ Log.info "Publishing #{Config.get!(:base_stage_name)} image" Run.docker "push #{Config.get!(:image)}:#{Config.get!(:base_stage_name)}-#{Config.get!(:current_branch)}" end desc "build", "Build docker stages" + option :target, required: false def build - Log.info "Building #{Config.get!(:base_stage_name)} image" - Run.docker_compose "build #{Config.get!(:base_stage_name)}" + if options[:target] + Log.info "Building #{options[:target]} image" + Run.docker_compose "build #{options[:target]}" + else + Log.info "Building #{Config.get!(:base_stage_name)} image" + Run.docker_compose "build #{Config.get!(:base_stage_name)}" - Log.info "Building #{Config.get!(:release_stage_name)} image" - Run.docker_compose "build #{Config.get!(:release_stage_name)}" + Log.info "Building #{Config.get!(:release_stage_name)} image" + Run.docker_compose "build #{Config.get!(:release_stage_name)}" + end end desc "cache", "Caches intermediate docker stages" def cache Log.info "Publishing #{Config.get!(:base_stage_name)} image"