dogids-cli 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dogids/deploy/web.rb +54 -4
- data/lib/dogids/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07d0fd4f76b92e76013081f27e9d2cdcf456b7d5
|
4
|
+
data.tar.gz: d0dd3752fba28661dea43e02f225ecfce7919af5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 626d46f2093795289f0c5e2fa6f40fb9bbd5cf948252b9b98bdb45433f3def4be06b8e8e21960ba77a26b9e445092ff6c88d7e2f163fb2506bcf68953367c442
|
7
|
+
data.tar.gz: 6260df51437a6defeec13d152bed7e87d5408c6eb8d51f826013a12222f00e5d26ae4a7757bab6841e68d16e898f78a2d1371c90aca476a969d455941a72107d
|
data/lib/dogids/deploy/web.rb
CHANGED
@@ -8,16 +8,66 @@ module Dogids
|
|
8
8
|
print_heading("Deploying dogids.com...")
|
9
9
|
|
10
10
|
Net::SSH.start("web1.dogids.codelation.net", "dogids") do |ssh|
|
11
|
-
|
12
|
-
|
13
|
-
commands << "git pull origin master"
|
14
|
-
ssh.exec!(commands.join("&& ")) do |_channel, _stream, data|
|
11
|
+
print_command("Checking the current git status...")
|
12
|
+
ssh.exec!(web_git_status_command) do |_channel, _stream, data|
|
15
13
|
print_command(data)
|
16
14
|
end
|
15
|
+
|
16
|
+
if yes?("-----> Continue with deployment? [no]")
|
17
|
+
print_command("Pulling latest from master...")
|
18
|
+
ssh.exec!(web_git_pull_command) do |_channel, _stream, data|
|
19
|
+
print_command(data)
|
20
|
+
end
|
21
|
+
|
22
|
+
print_command("Updating file permissions...")
|
23
|
+
ssh.exec!(web_update_permissions_command) do |_channel, _stream, data|
|
24
|
+
print_command(data)
|
25
|
+
end
|
26
|
+
end
|
17
27
|
end
|
18
28
|
|
19
29
|
print_heading("Done.")
|
20
30
|
end
|
21
31
|
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def web_git_pull_command
|
36
|
+
commands = []
|
37
|
+
commands << "cd /home/dogids/apps/dogids.com"
|
38
|
+
commands << "git pull origin master"
|
39
|
+
commands.join("&& ")
|
40
|
+
end
|
41
|
+
|
42
|
+
def web_git_status_command
|
43
|
+
commands = []
|
44
|
+
commands << "cd /home/dogids/apps/dogids.com"
|
45
|
+
commands << "git status -s"
|
46
|
+
commands.join("&& ")
|
47
|
+
end
|
48
|
+
|
49
|
+
def web_update_permissions_command
|
50
|
+
commands = []
|
51
|
+
app_path = "/home/dogids/apps/dogids.com"
|
52
|
+
writable_directories = [
|
53
|
+
"blog/wp-content",
|
54
|
+
"feeds",
|
55
|
+
"logs",
|
56
|
+
"ls_file_cache",
|
57
|
+
"resources",
|
58
|
+
"reviews_cache",
|
59
|
+
"temp",
|
60
|
+
"templates",
|
61
|
+
"uploaded"
|
62
|
+
]
|
63
|
+
|
64
|
+
writable_directories.each do |directory|
|
65
|
+
full_path = File.join(app_path, directory)
|
66
|
+
commands << "sudo chown dogids:www-data -R #{full_path}"
|
67
|
+
commands << "sudo chmod 775 -R #{full_path}"
|
68
|
+
end
|
69
|
+
|
70
|
+
commands.join("&& ")
|
71
|
+
end
|
22
72
|
end
|
23
73
|
end
|
data/lib/dogids/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dogids-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Pattison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|