dogids-cli 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dogids/base.rb +3 -1
- data/lib/dogids/deploy/staging.rb +5 -5
- data/lib/dogids/deploy/web.rb +4 -4
- data/lib/dogids/deploy/worker.rb +14 -6
- data/lib/dogids/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa07e0fb723b31824d0f81721700bd083d1b6211
|
4
|
+
data.tar.gz: f673d02dcd01b5ab7ce3a900c41e3dd35692c416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12cfade143faf878c3d9c17e0a3008a9def9d5165442c6f29669dfda3e57648fde24323c1b408670300f2b53cf34b224214da536d145170012977ed457ec7b68
|
7
|
+
data.tar.gz: f0f1178482676df50f887f46f14e5f0d06277b1fc3b669c628e96559de1cc932fa3453082b6ac8f498e0938d0a23cd587e8f9cb246858f7035ab8891d8945773
|
data/lib/dogids/base.rb
CHANGED
@@ -49,7 +49,9 @@ module Dogids
|
|
49
49
|
# Print a message to the terminal about a command that's going to run.
|
50
50
|
# @param command [String]
|
51
51
|
def print_command(command)
|
52
|
-
|
52
|
+
command.split("\n").each do |line|
|
53
|
+
print_wrapped(line, indent: 7)
|
54
|
+
end
|
53
55
|
end
|
54
56
|
|
55
57
|
# Run a command with Bash after first printing the command to the terminal.
|
@@ -5,10 +5,10 @@ module Dogids
|
|
5
5
|
class Cli < Thor
|
6
6
|
no_commands do
|
7
7
|
def deploy_staging
|
8
|
-
print_heading("Deploying dogids.com site to staging server
|
8
|
+
print_heading("Deploying dogids.com site to staging server")
|
9
9
|
|
10
10
|
Net::SSH.start("staging.dogids.com", "dogids") do |ssh|
|
11
|
-
print_command("Checking the current git status
|
11
|
+
print_command("Checking the current git status")
|
12
12
|
ssh.exec!(staging_git_status_command) do |_channel, _stream, data|
|
13
13
|
print_command(data)
|
14
14
|
end
|
@@ -24,15 +24,15 @@ module Dogids
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
branch = ask("----->
|
27
|
+
branch = ask("-----> Which branch would you like to deploy?").strip
|
28
28
|
return print_command("Fine, be that way.") if branch.length == 0
|
29
29
|
|
30
|
-
print_command("Pulling latest from #{branch}
|
30
|
+
print_command("Pulling latest from #{branch}")
|
31
31
|
ssh.exec!(staging_git_pull_command(branch)) do |_channel, _stream, data|
|
32
32
|
print_command(data)
|
33
33
|
end
|
34
34
|
|
35
|
-
print_command("Updating file permissions
|
35
|
+
print_command("Updating file permissions")
|
36
36
|
ssh.exec!(web_update_permissions_command) do |_channel, _stream, data|
|
37
37
|
print_command(data)
|
38
38
|
end
|
data/lib/dogids/deploy/web.rb
CHANGED
@@ -5,21 +5,21 @@ module Dogids
|
|
5
5
|
class Cli < Thor
|
6
6
|
no_commands do
|
7
7
|
def deploy_web
|
8
|
-
print_heading("Deploying dogids.com
|
8
|
+
print_heading("Deploying dogids.com")
|
9
9
|
|
10
10
|
Net::SSH.start("web1.dogids.codelation.net", "dogids") do |ssh|
|
11
|
-
print_command("Checking the current git status
|
11
|
+
print_command("Checking the current git status")
|
12
12
|
ssh.exec!(web_git_status_command) do |_channel, _stream, data|
|
13
13
|
print_command(data)
|
14
14
|
end
|
15
15
|
|
16
16
|
if yes?("-----> Continue with deployment? [no]")
|
17
|
-
print_command("Pulling latest from master
|
17
|
+
print_command("Pulling latest from master")
|
18
18
|
ssh.exec!(web_git_pull_command) do |_channel, _stream, data|
|
19
19
|
print_command(data)
|
20
20
|
end
|
21
21
|
|
22
|
-
print_command("Updating file permissions
|
22
|
+
print_command("Updating file permissions")
|
23
23
|
ssh.exec!(web_update_permissions_command) do |_channel, _stream, data|
|
24
24
|
print_command(data)
|
25
25
|
end
|
data/lib/dogids/deploy/worker.rb
CHANGED
@@ -5,21 +5,22 @@ module Dogids
|
|
5
5
|
class Cli < Thor
|
6
6
|
no_commands do
|
7
7
|
def deploy_worker
|
8
|
-
print_heading("Deploying dogids-backgrounder
|
8
|
+
print_heading("Deploying dogids-backgrounder")
|
9
9
|
|
10
10
|
Net::SSH.start("worker1.dogids.codelation.net", "dogids") do |ssh|
|
11
|
-
print_command("Pulling latest from master
|
11
|
+
print_command("Pulling latest from master")
|
12
12
|
ssh.exec!(worker_git_pull_command) do |_channel, _stream, data|
|
13
13
|
print_command(data)
|
14
14
|
end
|
15
15
|
|
16
|
-
print_heading("
|
17
|
-
ssh.exec!(
|
16
|
+
print_heading("Building application")
|
17
|
+
ssh.exec!(worker_build_command) do |_channel, _stream, data|
|
18
18
|
print_command(data)
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
print_heading("Restarting")
|
22
|
+
%w(clock web worker).each do |process|
|
23
|
+
command = "sudo start dogids-#{process} && sudo restart dogids-#{process}"
|
23
24
|
ssh.exec!(command) do |_channel, _stream, data|
|
24
25
|
print_command(data)
|
25
26
|
end
|
@@ -32,6 +33,13 @@ module Dogids
|
|
32
33
|
|
33
34
|
private
|
34
35
|
|
36
|
+
def worker_build_command
|
37
|
+
commands = []
|
38
|
+
commands << "cd /home/dogids/apps/dogids-backgrounder"
|
39
|
+
commands << "git archive master | docker run -v /tmp/dogids-backgrounder-cache:/tmp/cache:rw -i -a stdin -a stderr -a stdout flynn/slugbuilder - > slug.tgz"
|
40
|
+
commands.join("&& ")
|
41
|
+
end
|
42
|
+
|
35
43
|
def worker_git_pull_command
|
36
44
|
commands = []
|
37
45
|
commands << "cd /home/dogids/apps/dogids-backgrounder"
|
data/lib/dogids/version.rb
CHANGED
@@ -3,13 +3,13 @@ require "open-uri"
|
|
3
3
|
require "thor"
|
4
4
|
|
5
5
|
module Dogids
|
6
|
-
VERSION = "0.0.
|
6
|
+
VERSION = "0.0.8"
|
7
7
|
|
8
8
|
class Cli < Thor
|
9
9
|
desc "update", "Update dogids-cli to latest version"
|
10
10
|
def update
|
11
11
|
command = "gem install dogids-cli"
|
12
|
-
puts "Running #{command}
|
12
|
+
puts "Running #{command}"
|
13
13
|
exec(command)
|
14
14
|
end
|
15
15
|
|