1
0
mirror of https://github.com/danbee/cv synced 2025-03-04 08:59:12 +00:00
cv/deploy.rb

26 lines
503 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'net/ssh'
module CV
def CV.check_dir
return File.exists? "danbarbercv"
end
def CV.deploy
if check_dir
puts "Deploying..."
Net::SSH.start('vps2.danbee.co.uk', 'danbee') do |ssh|
# capture all stderr and stdout output from a remote process
ssh.exec!("cd ~/cv")
ssh.exec!("git pull origin")
ssh.exec!("stasis")
end
else
puts "Please run this from the projects directory."
end
end
end
CV.deploy