Skip to content

Commit

Permalink
added deploy_devel_all task, which deploys restservice from git tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kudlvasr committed Jan 9, 2010
1 parent a0b41b1 commit fccab63
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Rakefile
Expand Up @@ -12,14 +12,14 @@ end
vars = ['PKG_BUILD', 'RCOV_PARAMS', 'RAILS_ENV', 'RAILS_PARENT']
ENV['RAILS_PARENT'] = File.join(Dir.pwd, 'webservice')

env = ENV.map { |key,val| (ENV[key] && vars.include?( key )) ? %(#{key}="#{ENV[key]}") : nil }.reject {|x| x.nil?}.join(' ')
env = ENV.map { |key,val| (ENV[key] && vars.include?( key )) ? %(#{key}="#{ENV[key]}") : nil }.compact.join(' ')

plugins = Dir.glob('plugins/*')#.reject{|x| ['users'].include?(File.basename(x))}
PROJECTS = ['webservice', *plugins]
desc 'Run all tests by default'
task :default => :test

%w(test rdoc pgem package release install install_policies check_syntax package-local buildrpm buildrpm-local test:test:rcov restdoc).each do |task_name|
%w(test rdoc pgem package release install install_policies check_syntax package-local buildrpm buildrpm-local test:test:rcov restdoc deploy_local).each do |task_name|
desc "Run #{task_name} task for all projects"

task task_name do
Expand Down Expand Up @@ -67,6 +67,10 @@ task :doc do
puts "documentation successfully generated"
end

desc "Deploy for development - create dirs, install configuration files and custom yast modules. Then install and update PolKit policies for root."
# :install policies uses grantwebyastrights, which is installed in :deploy_local
task :deploy_local_all => [:deploy_local,:install_policies]

=begin
require 'metric_fu'
MetricFu::Configuration.run do |config|
Expand Down
13 changes: 13 additions & 0 deletions plugins/basesystem/Rakefile
Expand Up @@ -5,6 +5,19 @@ require 'rake/packagetask'
require File.join(File.dirname(__FILE__), 'config', 'rails_parent')
require File.join(RailsParent.parent, 'config', 'boot')
require 'tasks/rails'
# load the shared rake files from the package itself
# skip 'deploy_local' task, it's redefined here
require 'tasks/webservice_tasks'
WebserviceTasks.loadTasks(:exclude => ["deploy_local.rake"])

desc 'Default: run unit tests.'
task :default => :test

require 'fileutils'

desc 'Deploy for development - create basic dirs and install config files.'
task :deploy_local do |t|
FileUtils.mkdir_p "/etc/webyast"
FileUtils.mkdir_p "/var/lib/yastws/basesystem"
FileUtils.cp "package/basesystem.yml" "/etc/webyast"
end
14 changes: 14 additions & 0 deletions plugins/eulas/Rakefile
Expand Up @@ -5,6 +5,20 @@ require 'rake/packagetask'
require File.join(File.dirname(__FILE__), 'config', 'rails_parent')
require File.join(RailsParent.parent, 'config', 'boot')
require 'tasks/rails'
# load the shared rake files from the package itself
# skip 'deploy_local' task, it's redefined here
require 'tasks/webservice_tasks'
WebserviceTasks.loadTasks(:exclude => ["deploy_local.rake"])

desc 'Default: run unit tests.'
task :default => :test

require 'fileutils'

desc "Deploy for development - create basic dirs and install config files."
task :deploy_local do |t|
FileUtils.mkdir_p "/etc/webyast"
FileUtils.mkdir_p "/var/lib/yastws/eulas/accepted-licenses"
FileUtils.install "package/eulas-sles11.yml", "/etc/webyast/eulas.yml", :mode => 0644
FileUtils.cp_r "config/resources/licenses", "/var/lib/yastws/eulas"
end
9 changes: 9 additions & 0 deletions plugins/mail_settings/Rakefile
Expand Up @@ -5,7 +5,16 @@ require 'rake/packagetask'
require File.join(File.dirname(__FILE__), 'config', 'rails_parent')
require File.join(RailsParent.parent, 'config', 'boot')
require 'tasks/rails'
# load the shared rake files from the package itself
# skip 'deploy_local' task, it's redefined here
require 'tasks/webservice_tasks'
WebserviceTasks.loadTasks(:exclude => ["deploy_local.rake"])

desc 'Default: run unit tests.'
task :default => :test

desc 'Deploy for development - install yast modules.'
task :deploy_local do |t|
FileUtils.mkdir_p "/usr/share/YaST2/modules/YaPI/"
FileUtils.cp "package/MailSettings.pm", "/usr/share/YaST2/modules/YaPI"
end
9 changes: 9 additions & 0 deletions plugins/services/Rakefile
Expand Up @@ -4,7 +4,16 @@ require 'rake/rdoctask'
require File.join(File.dirname(__FILE__), 'config', 'rails_parent')
require File.join(RailsParent.parent, 'config', 'boot')
require 'tasks/rails'
# load the shared rake files from the package itself
# skip 'deploy_local' task, it's redefined here
require 'tasks/webservice_tasks'
WebserviceTasks.loadTasks(:exclude => ["deploy_local.rake"])

desc 'Default: run unit tests.'
task :default => :test

desc "Deploy for development - create basic dirs and install yast modules."
task :deploy_local do |t|
FileUtils.mkdir_p "/usr/share/YaST2/modules/"
FileUtils.cp_r "package/YML.rb", "/usr/share/YaST2/modules/"
end
9 changes: 9 additions & 0 deletions plugins/status/Rakefile
Expand Up @@ -5,8 +5,17 @@ require 'rake/packagetask'
require File.join(File.dirname(__FILE__), 'config', 'rails_parent')
require File.join(RailsParent.parent, 'config', 'boot')
require 'tasks/rails'
# load the shared rake files from the package itself
# skip 'deploy_local' task, it's redefined here
require 'tasks/webservice_tasks'
WebserviceTasks.loadTasks(:exclude => ["deploy_local.rake"])

desc 'Default: run unit tests.'
task :default => :test

desc "Deploy for development - create basic dirs and install yast modules."
task :deploy_local do |t|
FileUtils.mkdir_p "/usr/share/YaST2/modules/"
FileUtils.cp_r "package/LogFile.rb", "/usr/share/YaST2/modules/"
end

2 changes: 2 additions & 0 deletions webservice-tasks/lib/tasks/install_policies.rake
Expand Up @@ -11,5 +11,7 @@ task :install_policies do |t|
Dir.glob("**/*.policy").each do |policy|
FileUtils.cp("#{policy}", "/usr/share/PolicyKit/policy")
end
system "/usr/sbin/grantwebyastrights --user root --action grant >/dev/null 2>&1"
raise "Error on execute '#{$0} #{tracing} #{verbose} #{task_name}'" if $?.exitstatus != 0
end

16 changes: 16 additions & 0 deletions webservice/Rakefile
Expand Up @@ -23,3 +23,19 @@ namespace :doc do
rdoc.rdoc_files.include('test/plugin_basic_tests.rb')
}
end

# load the shared rake files from the package itself
# skip 'deploy_local' task, it's redefined here
require 'tasks/webservice_tasks'
WebserviceTasks.loadTasks(:exclude => ["deploy_local.rake"])

require 'fileutils'

desc "Deploy for development - run db:migrate, create basic dirs and install grantwebyastrights."
task :deploy_local => :"db:migrate" do |t|
FileUtils.mkdir_p "/etc/webyast"
FileUtils.mkdir_p "/var/lib/yastws"
FileUtils.mkdir_p "/usr/share/yastws"
FileUtils.install "package/grantwebyastrights", "/usr/sbin", :mode => 0555
end

0 comments on commit fccab63

Please sign in to comment.