This repository has been archived by the owner on Nov 29, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Rakefile
59 lines (47 loc) · 1.72 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __FILE__)
require "rubygems"
require "bundler"
Bundler.setup(:default, :test, :development)
require "bundler/gem_tasks"
require "rake/dsl_definition"
require "rake"
require "rspec/core/rake_task"
bosh_release = "cf-release"
target_bosh_release_path = File.expand_path("../bosh_release", __FILE__)
namespace :bosh do
namespace :release do
desc "Import latest #{bosh_release}"
task :import, :path do |t, args|
source_bosh_release = File.expand_path(args[:path])
unless File.directory?(source_bosh_release)
$stderr.puts "Please pass path to source bosh release"
exit 1
end
sh "rm -rf #{target_bosh_release_path}"
# required directories to pass bosh_cli validations
%w[config jobs packages src].each do |dir|
sh "mkdir -p #{target_bosh_release_path}/#{dir}"
sh "touch #{target_bosh_release_path}/#{dir}/.gitkeep"
end
chdir(target_bosh_release_path) do
sh "cp -R #{source_bosh_release}/releases #{target_bosh_release_path}"
sh "cp -R #{source_bosh_release}/.final_builds #{target_bosh_release_path}"
sh "cp -R #{source_bosh_release}/config/final.yml #{target_bosh_release_path}/config"
end
end
desc "Remove any large temporary tgz from internal bosh_release"
task :clean do
chdir(target_bosh_release_path) do
sh "ls .final_builds/**/*.tgz | xargs rm; true"
sh "ls releases/**/*.tgz | xargs rm; true"
end
end
end
end
task :release => "bosh:release:clean"
desc "Run specs"
unit_rspec_task = RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = "spec/*_spec.rb"
t.rspec_opts = %w(--format progress --color)
end
task :default => :spec