initial import

This commit is contained in:
2009-12-10 20:45:56 +02:00
commit 14f518ce91
44 changed files with 1867 additions and 0 deletions

17
init/actions/activate.rb Normal file
View File

@@ -0,0 +1,17 @@
class ActivateAction < Action
def default
puts "please specify project"
end
def method_missing(project, *args)
Projects.send(project).activate(*args)
Action.perms :ensure
end
def all
Projects.activate
Action.perms :ensure
end
end

17
init/actions/active.rb Normal file
View File

@@ -0,0 +1,17 @@
class ActiveAction < Action
def default
puts "please specify project"
end
def method_missing(project, *args)
puts Projects.send(project).status["active"]
end
def all
Projects.list.each do |name, project|
puts "#{name.camelize}: #{project.status["active"]}"
end
end
end

15
init/actions/checkout.rb Normal file
View File

@@ -0,0 +1,15 @@
class CheckoutAction < Action
def default
puts "please specify project"
end
def method_missing(project, *args)
Projects.send(project).checkout(*args)
end
def all
Projects.checkout
end
end

View File

@@ -0,0 +1,11 @@
class HasLatestAction < Action
def default
Projects.has_latest?
end
def method_missing(*args)
Projects.has_latest?(*args)
end
end

7
init/actions/perms.rb Normal file
View File

@@ -0,0 +1,7 @@
class PermsAction < Action
def ensure
shell "chown -R www-data:www-data #{$skyhook_root}/www"
end
end

35
init/actions/update.rb Normal file
View File

@@ -0,0 +1,35 @@
class UpdateAction < Action
def default
skyhook
end
def all
skyhook
projects
end
def method_missing(project, *args)
Projects.send(project).checkout(*args)
Action.perms :ensure
end
def projects(*args)
Projects.checkout(*args)
Action.perms :ensure
end
def skyhook
SVN.up(nil, $skyhook_root)
shell "#{$skyhook_root}/init/rc.rb update.post_skyhook"
if $console
exec "irb -r #{$skyhook_root}/init/init.rb"
end
end
def post_skyhook
Action.perms :ensure
Projects.init
end
end