# -*- coding: utf-8 -*- $:.unshift 'lib' require 'dcmgr/rubygems' require 'rake/clean' require 'dcmgr' task :environment do Dcmgr.configure 'config/dcmgr.conf' end namespace :db do desc 'Create all database tables' task :init => [ :environment ] do Dcmgr.run_initializers(:sequel) Sequel.extension :migration Sequel::Migrator.apply(Sequel::DATABASES.first, File.expand_path('../config/db/migrations', __FILE__), 9999) end desc 'Drop all database tables' task :drop => [ :environment ] do Dcmgr.run_initializers(:sequel) Sequel.extension :migration Sequel::Migrator.apply(Sequel::DATABASES.first, File.expand_path('../config/db/migrations', __FILE__), 0) end end desc 'run bundle command to install vendored gems.' task :bundle do sh <<_ENDCMD mkdir .bundle cat < .bundle/config --- BUNDLE_DISABLE_SHARED_GEMS: "1" BUNDLE_PATH: vendor/bundle END_ _ENDCMD sh "bundle install" end desc 'build gem packages' task :gem do require 'rubygems' require 'rake/gempackagetask' spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.version = Dcmgr::VERSION s.authors = ['axsh Ltd.'] s.email = ['dev@axsh.net'] s.homepage = 'http://wakame.jp/' s.name = 'wakame-vdc-dcmgr' s.summary = "Wakame-VDC: Server modules" s.description = 'Datacenter Hypervisor' s.require_path = 'lib' s.required_ruby_version = '>= 1.8.7' s.files = Dir['config/**/*.rb', 'lib/**/*.rb', 'web/api/public/**/*.*', 'web/metadata/public/**/*.*'] + %w(Rakefile LICENSE NOTICE web/api/config.ru web/metadata/config.ru config/dcmgr.conf.example) s.bindir='bin' s.executables = %w(collector) s.add_dependency "isono", "0.2.9" s.add_dependency "log4r" s.add_dependency "extlib", '0.9.15' s.add_dependency "configuration" s.add_dependency "ruby-hmac" s.add_dependency "ipaddress", '0.7.0' s.add_dependency "rack", ">= 1.3.2" s.add_dependency "sinatra", "1.2.6" s.add_dependency "json", ">= 1.2.0" s.add_dependency "sequel", "3.27.0" s.add_dependency "mysql", ">= 2.8.1" s.add_dependency "net-dhcp", ">= 1.1.0" s.add_dependency "bit-struct", ">= 0.13.6" s.add_dependency "racket", ">= 1.0.11" s.add_development_dependency 'bacon' s.add_development_dependency 'rake' end File.open("#{spec.name}.gemspec", 'w'){|f| f.write(spec.to_ruby) } sh "gem build #{spec.name}.gemspec" spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.version = Dcmgr::VERSION s.authors = ['axsh Ltd.'] s.email = ['dev@axsh.net'] s.homepage = 'http://wakame.jp/' s.name = 'wakame-vdc-agents' s.summary = "Wakame-VDC: Agent modules" s.description = 'Datacenter Hypervisor' s.require_path = 'lib' s.required_ruby_version = '>= 1.8.7' s.files = Dir['config/**/*.rb', 'lib/**/*.rb'] + %w(Rakefile LICENSE NOTICE config/hva.conf.example config/nsa.conf.example) s.bindir='bin' s.executables = %w(hva sta nsa) s.add_dependency "isono", "0.2.9" s.add_dependency "log4r" s.add_dependency "extlib", '0.9.15' s.add_dependency "configuration" s.add_dependency "ruby-hmac" s.add_dependency "ipaddress", '0.7.0' s.add_dependency "open4" s.add_development_dependency 'bacon' s.add_development_dependency 'rake' end File.open("#{spec.name}.gemspec", 'w'){|f| f.write(spec.to_ruby) } sh "gem build #{spec.name}.gemspec" end