Skip to content

Commit

Permalink
update for docker changes
Browse files Browse the repository at this point in the history
  • Loading branch information
robplan committed Sep 5, 2024
1 parent 0b58997 commit 62a3499
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 38 deletions.
97 changes: 61 additions & 36 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
neptuno (1.3.0)
neptuno (1.4.1)
dotiw
dry-cli
hirb
Expand All @@ -17,59 +17,83 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
activesupport (7.2.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
ansi (1.5.0)
ast (2.4.2)
builder (3.2.4)
concurrent-ruby (1.2.2)
diff-lcs (1.5.0)
base64 (0.2.0)
bigdecimal (3.1.8)
builder (3.3.0)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
diff-lcs (1.5.1)
dotiw (5.3.3)
activesupport
i18n
dry-cli (1.0.0)
drb (2.2.1)
dry-cli (1.1.0)
hirb (0.7.3)
i18n (1.14.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.6.2)
minitest (5.16.3)
minitest-reporters (1.5.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
logger (1.6.1)
minitest (5.25.1)
minitest-reporters (1.7.1)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
parallel (1.22.1)
parser (3.1.2.1)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
pastel (0.8.0)
tty-color (~> 0.5)
psych (3.3.4)
racc (1.8.1)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.6.0)
rexml (3.2.5)
rubocop (1.39.0)
rake (13.2.1)
regexp_parser (2.9.2)
rubocop (1.66.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.1.2.1)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.23.0, < 2.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.23.0)
parser (>= 3.1.1.0)
rubocop-performance (1.15.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.11.0)
standard (1.18.0)
rubocop (= 1.39.0)
rubocop-performance (= 1.15.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
parser (>= 3.3.1.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
securerandom (0.3.1)
standard (1.35.0.1)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.62)
standard-custom (~> 1.0.0)
standard-performance (~> 1.3)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.4.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.21.0)
tty-color (0.6.0)
tty-command (0.10.1)
pastel (~> 0.8)
Expand All @@ -86,17 +110,18 @@ GEM
tty-cursor (~> 0.7)
tty-screen (~> 0.8)
wisper (~> 2.0)
tty-screen (0.8.1)
tty-screen (0.8.2)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
tty-which (0.5.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.3.0)
unicode-display_width (2.5.0)
wisper (2.0.1)
zeitwerk (2.6.11)
zeitwerk (2.6.18)

PLATFORMS
arm64-darwin-22
x86_64-darwin-21
x86_64-darwin-22
x86_64-linux
Expand All @@ -110,4 +135,4 @@ DEPENDENCIES
standard

BUNDLED WITH
2.3.14
2.5.18
2 changes: 2 additions & 0 deletions lib/neptuno/docker/down.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Down < Neptuno::CLI::Base
desc 'Docker: Stop docker containers for current project'

option :all, type: :boolean, default: false, desc: 'Run on all services'
option :volumes, type: :boolean, default: false, desc: 'Remove named volumes'
argument :services, type: :array, required: false, desc: 'Optional list of services'

def call(services: [], **options)
Expand All @@ -15,6 +16,7 @@ def call(services: [], **options)
services_to_stop = services.intersection(services_with_procs).intersection(running_services)
system("cd #{neptuno_path} && docker compose stop -t 0 #{services.join(' ')}")
system("cd #{neptuno_path} && docker compose rm -f #{services.join(' ')}")
system("cd #{neptuno_path} && docker compose down -v #{services.join(' ')}") if options.fetch(:volumes)
if config.fetch('procfile_manager') == 'tmux'
services_to_stop.each do |service|
system("tmux kill-session -t #{service} 2>/dev/null ")
Expand Down
5 changes: 4 additions & 1 deletion lib/neptuno/tty/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ def running_services
end

def json_services_status
JSON.parse(`cd #{neptuno_path} && docker compose ps --all --format json`).map do |service|
neptuno_path = './'
services = `cd #{neptuno_path} && docker compose ps --all --format json`.split("\n")
services.map do |line|
service = JSON.parse(line)
[service.dig('Service'), service.dig('Status')]
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/neptuno/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Neptuno
VERSION = '1.4.0'
VERSION = '1.4.2'
end

0 comments on commit 62a3499

Please sign in to comment.