-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadm
More file actions
52 lines (47 loc) · 1.07 KB
/
adm
File metadata and controls
52 lines (47 loc) · 1.07 KB
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
#!/bin/env ruby
# heroku db:pull sqlite://meine.db
def c(cmd)
print "\n===> #{cmd}\n"
system(cmd)
end
def zipme
c("rm public/pp-sextant.tar.gz")
ign = File.read("./.gitignore")
files = Dir.entries(".").reject!{|d|
d == "." ||
d == ".." ||
d == "config.rb" ||
d == ".git" ||
d == ".gitignore" ||
ign.include?(d)
}
c("tar czvf dont_deploy/pp-sextant.tar.gz #{files.join(' ')}")
c("mv dont_deploy/pp-sextant.tar.gz public/pp-sextant.tar.gz")
end
def deploy
c "git add ."
c "git commit -m '.'"
c "git push heroku"
end
while true
print "\x1b[2J"
print "0. Maintenance ON'\n"
print "1. Maintenance OFF'\n"
print "R. run 'ruby main.rb'\n"
print "Z. ZIP sources\n"
print "D. Deploy\n"
print "L. Logfile\n"
print "\nQ Quit\n\n: "
ans = gets
case ans.strip.downcase
when 'z' : zipme
when 'd' : deploy
when 'r' : c("ruby main.rb")
when 'l' : c("heroku logs | less")
when '0' : c("heroku maintenance:on")
when '1' : c("heroku maintenance:off")
when 'q' : exit
end
print "Weiter mit <ENTER>"
gets
end