@@ -42,58 +42,8 @@ namespace :stemcell do
4242 end
4343 end
4444
45- desc 'Download a remote pre-built base OS image'
46- task :download_os_image , [ :operating_system_name , :operating_system_version ] do |_ , args |
47- begin
48- puts "Using OS image #{ args . operating_system_name } -#{ args . operating_system_version } "
49-
50- mkdir_p ( 'tmp' )
51-
52- metalink_path = File . join (
53- Dir . pwd ,
54- 'bosh-stemcell' ,
55- 'image-metalinks' ,
56- "#{ args . operating_system_name } -#{ args . operating_system_version } .meta4"
57- )
58-
59- os_image_path = File . join ( Dir . pwd , 'tmp' , 'base_os_image.tgz' )
60- `meta4 file-download --file #{ args . operating_system_name } -#{ args . operating_system_version } .tgz --metalink #{ metalink_path } #{ os_image_path } `
61- raise 'Failed to download metalink' if $?. exitstatus != 0
62-
63- puts "Successfully downloaded OS image to #{ os_image_path } "
64- rescue RuntimeError => e
65- print_help
66- raise e
67- end
68- end
69-
70- desc 'Build a stemcell with a remote pre-built base OS image'
71- task :build , [ :infrastructure_name , :hypervisor_name , :operating_system_name , :operating_system_version , :build_number ] do |_ , args |
72- begin
73- Rake ::Task [ 'stemcell:download_os_image' ] . invoke (
74- args . operating_system_name ,
75- args . operating_system_version
76- )
77-
78- os_image_path = File . join ( Dir . pwd , 'tmp' , 'base_os_image.tgz' )
79- args . with_defaults ( build_number : '0000' )
80-
81- Rake ::Task [ 'stemcell:build_with_local_os_image' ] . invoke (
82- args . infrastructure_name ,
83- args . hypervisor_name ,
84- args . operating_system_name ,
85- args . operating_system_version ,
86- os_image_path ,
87- args . build_number
88- )
89- rescue RuntimeError => e
90- print_help
91- raise e
92- end
93- end
94-
95- desc 'Build a stemcell using a local pre-built base OS image'
96- task :build_with_local_os_image , [ :infrastructure_name , :hypervisor_name , :operating_system_name , :operating_system_version , :os_image_path , :build_number ] do |_ , args |
45+ desc 'Build a stemcell, requires `os_image_path` pointing at an image created via `stemcell:build_os_image`'
46+ task :build , [ :infrastructure_name , :hypervisor_name , :operating_system_name , :operating_system_version , :os_image_path , :build_number ] do |_ , args |
9747 begin
9848 require 'bosh/stemcell/build_environment'
9949 require 'bosh/stemcell/definition'
0 commit comments