dogids-cli 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9becc796a407d3752471e2c8ef203db609d8436d
4
- data.tar.gz: 76eaf5e85b6251987bfe88bb4bd859367a0b0848
3
+ metadata.gz: aa07e0fb723b31824d0f81721700bd083d1b6211
4
+ data.tar.gz: f673d02dcd01b5ab7ce3a900c41e3dd35692c416
5
5
  SHA512:
6
- metadata.gz: ebf24f6097016edf30f4512870f83ed982fd63b61ee94bb6572210bbb68387fdc752fc0346ca9c279d86f28ca129924a08643f26415404a358b8a9618c4e0c5d
7
- data.tar.gz: 4ba7b749b1766f55c33edcae555bd51d669ddeb35da910d19bcbaa30d60f26a17a74a3f126525d7e40cba538e40629ad6266ea5483ec055ddc2415be09e24093
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
- print_wrapped(command, indent: 7)
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("-----> What branch would you like to deploy?").strip
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
@@ -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
@@ -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("Running bundle install...")
17
- ssh.exec!(worker_bundle_install_command) do |_channel, _stream, data|
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
- if yes?("-----> Do you want to restart Sidekiq? [no]")
22
- command = "sudo restart dogids-backgrounder"
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"
@@ -3,13 +3,13 @@ require "open-uri"
3
3
  require "thor"
4
4
 
5
5
  module Dogids
6
- VERSION = "0.0.7"
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dogids-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Pattison