lib/dockly/deb.rb in dockly-2.2.0 vs lib/dockly/deb.rb in dockly-2.3.0
- old
+ new
@@ -24,10 +24,11 @@
def file(source, destination)
@files << { :source => source, :destination => destination }
end
def create_package!
+ info "creating package"
ensure_present! :build_dir, :deb_build_dir
FileUtils.mkdir_p(File.join(build_dir, deb_build_dir))
FileUtils.rm(build_path) if File.exist?(build_path)
debug "exporting #{package_name} to #{build_path}"
build_package
@@ -39,13 +40,11 @@
@dir_package.cleanup if @dir_package
@deb_package.cleanup if @deb_package
end
def build
- info "creating package"
create_package!
- info "uploading to s3"
upload_to_s3
end
def build_path
ensure_present! :build_dir, :deb_build_dir
@@ -62,9 +61,10 @@
"#{s3_url}"
false
end
def upload_to_s3
+ info "uploading to s3"
return if s3_bucket.nil?
raise "Package wasn't created!" unless File.exist?(build_path)
info "uploading package to s3"
Dockly::AWS.s3.put_bucket(s3_bucket) rescue nil
Dockly::AWS.s3.put_object(s3_bucket, s3_object_name, File.new(build_path))