lib/dockly/rake_task.rb in dockly-2.5.3 vs lib/dockly/rake_task.rb in dockly-2.6.0
- old
+ new
@@ -54,10 +54,11 @@
end
prepare_targets = []
upload_targets = []
build_targets = []
+ copy_targets = []
namespace :deb do
Dockly.debs.values.each do |inst|
namespace :prepare do
task inst.name => 'dockly:load' do |name|
@@ -69,17 +70,24 @@
deb inst.name => 'dockly:load' do |name|
inst.upload_to_s3
end
end
+ namespace :copy do
+ task inst.name => 'dockly:load' do |name|
+ inst.copy_from_s3(Dockly::History.duplicate_build_sha[0..6])
+ end
+ end
+
deb inst.name => [
'dockly:load',
"dockly:deb:prepare:#{inst.name}",
"dockly:deb:upload:#{inst.name}"
]
prepare_targets << "dockly:deb:prepare:#{inst.name}"
upload_targets << "dockly:deb:upload:#{inst.name}"
+ copy_targets << "dockly:deb:copy:#{inst.name}"
build_targets << "dockly:deb:#{inst.name}"
end
end
namespace :rpm do
@@ -94,17 +102,24 @@
rpm inst.name => 'dockly:load' do |name|
inst.upload_to_s3
end
end
+ namespace :copy do
+ task inst.name => 'dockly:load' do |name|
+ inst.copy_from_s3(Dockly::History.duplicate_build_sha[0..6])
+ end
+ end
+
rpm inst.name => [
'dockly:load',
"dockly:rpm:prepare:#{inst.name}",
"dockly:rpm:upload:#{inst.name}"
]
prepare_targets << "dockly:rpm:prepare:#{inst.name}"
upload_targets << "dockly:rpm:upload:#{inst.name}"
+ copy_targets << "dockly:rpm:copy:#{inst.name}"
build_targets << "dockly:rpm:#{inst.name}"
end
end
namespace :docker do
@@ -126,24 +141,43 @@
Thread.current[:rake_task] = inst.name
inst.export_only
end
end
+ namespace :copy do
+ task inst.name => 'dockly:load' do
+ Thread.current[:rake_task] = inst.name
+ inst.copy_from_s3(Dockly::History.duplicate_build_sha[0..6])
+ end
+ end
+
docker inst.name => [
'dockly:load',
"dockly:docker:prepare:#{inst.name}",
"dockly:docker:upload:#{inst.name}"
]
# Docker image will be generated by 'dockly:deb:package'
unless inst.s3_bucket.nil?
prepare_targets << "dockly:docker:prepare:#{inst.name}"
upload_targets << "dockly:docker:upload:#{inst.name}"
+ copy_targets << "dockly:docker:copy:#{inst.name}"
build_targets << "dockly:docker:#{inst.name}"
end
end
end
multitask :prepare_all => prepare_targets
multitask :upload_all => upload_targets
multitask :build_all => build_targets
+ multitask :copy_all => copy_targets
+
+ task :build_or_copy_all do
+ if Dockly::History.duplicate_build?
+ Rake::Task['dockly:copy_all'].invoke
+ else
+ Rake::Task['dockly:build_all'].invoke
+ Dockly::History.write_content_tag!
+ Dockly::History.push_content_tag!
+ end
+ end
end