lib/rmd/deploy_service.rb in rmdd-0.1.2 vs lib/rmd/deploy_service.rb in rmdd-0.1.3
- old
+ new
@@ -4,17 +4,17 @@
class ServerNotFound < StandardError; end
class DeployService
def self.deploy(server)
validate(server)
- system("curl -s #{url(server)}/deploy/#{token(server)}")
+ system_cmd("curl -s #{url(server)}/deploy/#{token(server)}")
end
def self.restart(server)
validate(server)
command = %{echo "cd #{NAME} && sh deploy.sh" | ssh #{master(server)} -p 2200}
- system(command)
+ system_cmd(command)
end
private
def self.validate(server)
@@ -33,8 +33,13 @@
Server.get(server).token
end
def self.master(server)
Server.get(server).master
+ end
+
+ def self.system_cmd(cmd)
+ $stdout.puts(cmd)
+ system(cmd)
end
end
end