-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
46 lines (34 loc) · 1.12 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'bundler'
Bundler.setup
require 'rspec/core/rake_task'
LOGIN_USER = "root"
WYRD_SERVER = "186.202.61.143"
task :default => [:spec]
task RSpec::Core::RakeTask.new
desc "Clean local configuration files"
task :clean do |t|
print "[wyrd] Cleaning local files... "
%x(rm -rf ../wyrd_*)
puts "done!"
print "[wyrd] Cleaning server files... "
%x(ssh #{LOGIN_USER}@#{WYRD_SERVER} 'rm -rf wyrd*')
puts "done!"
end
desc "Generate debian package and deploy it"
task :deploy => [:clean] do |t|
puts "[wyrd] Generating the Debian package"
%x(dpkg-buildpackage)
puts "[wyrd] Debian package done!"
puts "[wyrd] Copying the Debian package to wyrd server"
%x(scp ../wyrd*.deb #{LOGIN_USER}@#{WYRD_SERVER}:~)
puts "[wyrd] Installing the new version"
%x(ssh #{LOGIN_USER}@#{WYRD_SERVER} 'dpkg -i wyrd*')
puts "[wyrd] Installation done! \\,,/"
# Removing bundler configurations in development
%x(rm -rf .bundle)
end
desc "Backup quotes"
task :backup do |t|
puts "[wyrd] Backup quotes"
%x(ssh #{LOGIN_USER}@#{WYRD_SERVER} 'tar czvf ~/wyrd_quotes-#{Time.now.strftime("%d%m%Y")}.tar.gz /opt/wyrd/talk_files/*.yml')
end