forked from jonniespratley/angular-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile.rb
executable file
·101 lines (80 loc) · 2.49 KB
/
Rakefile.rb
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# @author Jonnie Spratley
# @note This file contains tasks to help with deployment to live server, building the scripts, and cleaning up files.
#
#cleanup
desc "remove all files from the temp folder"
task :cleanup do
FileUtils.rm_rf "./temp/*"
end
#build
desc "Build the scripts and move to the public folder"
task :build do
end
#deploy
desc "Deploy distribution build to web server"
task :deploy_d => :build do
require 'net/ssh'
require 'net/scp'
server = 'jonniespratley.me'
login = 'jonnie'
Net::SSH.start(server, login, :password => "fred3212") do |ssh|
ssh.scp.upload!("www", "/var", { :recursive => true, :verbose => true }) do |ch, name, sent, total|
puts "#{name}: #{sent}/#{total}"
end
end
end
#deploy to development server
#deploy to staging server
desc "Deploy distribution build to test server"
task :deploy_t => :build do
require 'net/ssh'
require 'net/scp'
server = 'jonniespratley.me'
login = 'jonnie'
Net::SSH.start(server, login, :password => "fred3212") do |ssh|
ssh.scp.upload!("www", "/var", { :recursive => true, :verbose => true }) do |ch, name, sent, total|
puts "#{name}: #{sent}/#{total}"
end
end
end
#deploy to production server
desc "Deploy distribution build to production server"
task :deploy => :build do
require 'net/ssh'
require 'net/scp'
server = 'myappmatrix.com'
login = 'jonnie'
Net::SSH.start(server, login, :password => "fred3212") do |ssh|
ssh.scp.upload!("www", "/var", { :recursive => true, :verbose => true }) do |ch, name, sent, total|
puts "#{name}: #{sent}/#{total}"
end
end
end
#deploy scripts to production server
desc "Deploy distribution scripts to production server"
task :deploy_scripts => :build do
require 'net/ssh'
require 'net/scp'
server = 'jonniespratley.me'
login = 'jonnie'
Net::SSH.start(server, login, :password => "fred3212") do |ssh|
ssh.scp.upload!("www/dist", "/var/www", { :recursive => true, :verbose => true }) do |ch, name, sent, total|
puts "#{name}: #{sent}/#{total}"
end
end
end
#deploy to production server
desc "Deploy .htaccess to production server"
task :deploy_htacess => :build do
require 'net/ssh'
require 'net/scp'
server = 'jonniespratley.me'
login = 'jonnie'
Net::SSH.start(server, login, :password => "fred3212") do |ssh|
#Upload root .htaccess file
ssh.scp.upload!(".htaccess", "/var/www", { :recursive => true, :verbose => true }) do |ch, name, sent, total|
puts "#{name}: #{sent}/#{total}"
end
end
end