mirror of
https://github.com/jimeh/skyhook.git
synced 2026-02-19 11:06:38 +00:00
initial import
This commit is contained in:
17
init/actions/activate.rb
Normal file
17
init/actions/activate.rb
Normal 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
17
init/actions/active.rb
Normal 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
15
init/actions/checkout.rb
Normal 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
|
||||
11
init/actions/has_latest.rb
Normal file
11
init/actions/has_latest.rb
Normal 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
7
init/actions/perms.rb
Normal 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
35
init/actions/update.rb
Normal 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
|
||||
Reference in New Issue
Block a user