Skip to content

Commit

Permalink
isolate chef kitchen rake tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
vlewin committed Apr 4, 2014
1 parent 54e0ffe commit daea942
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
20 changes: 0 additions & 20 deletions Rakefile
Expand Up @@ -41,23 +41,3 @@ task :build => [:default] do
sh 'osc -A https://api.suse.de build SLE_12 x86_64 --no-verify'

end

require_relative 'jenkins/cloud_vm.rb'

namespace :cloud do
namespace :vm do
desc 'Creates and starts new VM instance on cloud.suse.de; Optional parameter: name'
task :create, :name do |t, args|
args.has_key?(:name) ? Cloud::VM.create(args[:name]) : Cloud::VM.create
end

desc 'Terminate VM instance on cloud.suse.de; Required parameter: name'
task :terminate, :name do |t, args|
if args.has_key?(:name)
Cloud::VM.destroy(args[:name])
else
puts 'Please specify the name of the virtual machine'
end
end
end
end
21 changes: 21 additions & 0 deletions kitchen/Rakefile
@@ -0,0 +1,21 @@
$LOAD_PATH << 'lib'

require 'cloud_vm'

namespace :cloud do
namespace :vm do
desc 'Creates and starts new VM instance on cloud.suse.de; Optional parameter: name'
task :create, :name do |t, args|
args.has_key?(:name) ? Cloud::VM.create(args[:name]) : Cloud::VM.create
end

desc 'Terminate VM instance on cloud.suse.de; Required parameter: name'
task :terminate, :name do |t, args|
if args.has_key?(:name)
Cloud::VM.destroy(args[:name])
else
puts 'Please specify the name of the virtual machine'
end
end
end
end

0 comments on commit daea942

Please sign in to comment.