lib/cide.rb in cide-0.0.4 vs lib/cide.rb in cide-0.0.5
- old
+ new
@@ -81,29 +81,30 @@
method_option 'host_export_dir',
desc: 'Output directory on host to put build artefacts in',
aliases: ['o'],
default: nil
- method_option 'run',
- desc: 'The script to run',
- aliases: ['r'],
- default: DefaultConfig.run
-
method_option 'export',
desc: 'Are we expecting to export artifacts',
type: :boolean,
default: false
+ method_option 'run',
+ desc: 'The script to run',
+ aliases: ['r'],
+ default: DefaultConfig.run
+
def build
setup_docker
config = DefaultConfig.merge(YAML.load_file(CONFIG_FILE)).merge(options)
config.host_export_dir ||= config.export_dir
tag = "cide/#{docker_id(options[:name])}"
say_status :config, config.to_h
+ # FIXME: Move Dockerfile out of the way if it exists
if !File.exist?(DOCKERFILE)
say_status :Dockerfile, 'Creating temporary Dockerfile'
File.write(DOCKERFILE, config.to_dockerfile)
at_exit do
File.unlink(DOCKERFILE)
@@ -214,10 +215,10 @@
end
def docker(*args)
opts = args.last.is_a?(Hash) ? args.pop : {}
ret = run Shellwords.join(['docker'] + args), opts
- fail 'Command failed' if $CHILD_STATUS.exitstatus > 0
+ fail 'Command failed' if $?.exitstatus > 0
ret
end
end
end