Skip to content

Commit

Permalink
1.4.10
Browse files Browse the repository at this point in the history
  • Loading branch information
robplan committed Nov 22, 2024
1 parent ebd87b5 commit 538c5d1
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 45 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gem-push_new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Ruby 2.6
- name: Set up Ruby 3.3.0
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.x
ruby-version: 3.3.0

- name: Publish to GPR
run: |
Expand Down
40 changes: 22 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
neptuno (1.4.8)
neptuno (1.4.10)
dotiw
dry-cli
hirb
Expand All @@ -17,8 +17,9 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (7.2.1)
activesupport (8.0.0)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
Expand All @@ -28,9 +29,11 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ansi (1.5.0)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
builder (3.3.0)
concurrent-ruby (1.3.4)
Expand All @@ -40,22 +43,22 @@ GEM
activesupport
i18n
drb (2.2.1)
dry-cli (1.1.0)
dry-cli (1.2.0)
hirb (0.7.3)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.7.2)
json (2.8.2)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
logger (1.6.1)
minitest (5.25.1)
minitest (5.25.2)
minitest-reporters (1.7.1)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
parallel (1.26.3)
parser (3.3.5.0)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
pastel (0.8.0)
Expand All @@ -65,7 +68,7 @@ GEM
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
rubocop (1.66.1)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -75,25 +78,25 @@ GEM
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.3)
rubocop-ast (1.36.1)
parser (>= 3.3.1.0)
rubocop-performance (1.21.1)
rubocop-performance (1.22.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)
securerandom (0.3.2)
standard (1.42.1)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.62)
rubocop (~> 1.68.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.3)
standard-performance (~> 1.5)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.4.0)
standard-performance (1.5.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.21.0)
rubocop-performance (~> 1.22.0)
tty-color (0.6.0)
tty-command (0.10.1)
pastel (~> 0.8)
Expand All @@ -116,9 +119,10 @@ GEM
tty-which (0.5.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)
uri (1.0.2)
wisper (2.0.1)
zeitwerk (2.6.18)
zeitwerk (2.7.1)

PLATFORMS
arm64-darwin-22
Expand Down
5 changes: 0 additions & 5 deletions lib/neptuno/docker/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ class Build < Neptuno::CLI::Base
def call(services: [], **options)
command_services_to('build', all: options.fetch(:all), services_as_args: services) do |services|
make_service_files(services)
populated = system("cd #{neptuno_path}/services/#{service} 2>/dev/null && git add .")
unless populated
puts 'Initializing git submodule'
system("cd #{neptuno_path}/services/#{service} 2>/dev/null && git submodule update --init --recursive #{neptuno_path}/services/#{service}")
end
opts = options.fetch(:options, nil) || get_gpr
services.each do |service|
puts '********************'
Expand Down
4 changes: 2 additions & 2 deletions lib/neptuno/docker/down.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class Down < Neptuno::CLI::Base

def call(services: [], **options)
command_services_to('go down', all: options.fetch(:all), services_as_args: services) do |services|
make_service_files(services)
services_to_stop = services.intersection(services_with_procs).intersection(running_services)
make_service_files(services_to_stop)
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)
Expand All @@ -23,7 +23,7 @@ def call(services: [], **options)
puts "Neptuno killed Tmux session for: #{service}" if `echo $TMUX`.strip.empty?
end
else
# system("cd #{neptuno_path} && tmux kill-session -t neptuno")
system("cd #{neptuno_path} && tmux kill-session -t neptuno") if options.fetch(:all)
services_to_stop.each do
system("cd #{neptuno_path}/procfiles/#{service} && rm .overmind.sock > /dev/null 2>&1")
end
Expand Down
9 changes: 0 additions & 9 deletions lib/neptuno/docker/up.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ class Up < Neptuno::CLI::Base
def call(services: [], **options)
command_services_to('come up', all: options.fetch(:all), services_as_args: services) do |services, _project|
make_service_files(services)

services.each do |service|
populated = system("cd #{neptuno_path}/services/#{service} 2>/dev/null && git add .")
unless populated
puts 'Initializing git submodule'
system("cd #{neptuno_path}/services/#{service} 2>/dev/null && git submodule update --init --recursive #{neptuno_path}/services/#{service}")
end
end

system("cd #{neptuno_path} && docker compose up -d --wait #{services.join(' ')}")
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/neptuno/overmind/connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class Connect < Neptuno::CLI::Base

def call(services: [], **options)
command_services_to('connect to procs', all: options.fetch(:all), services_as_args: services) do |services|
`neptuno up #{services.join(' ')}` if options.fetch(:up)
original_services = services
services = services_with_procs.intersection(get_dependants(services).concat(services).uniq).sort
`neptuno up #{services.join(' ')}` if options.fetch(:up)

outside_tmux = `echo $TMUX`.strip.empty?

Expand Down
8 changes: 2 additions & 6 deletions lib/neptuno/services/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ def call(services: [], **options)
services.each do |service|
puts "---Updating #{service}---"
current_branch = `git branch --show-current`
puts "Current branch #{current_branch}\r\n"
populated = system("cd #{neptuno_path}/services/#{service} 2>/dev/null && git add . && git stash save -u -q neptuno_stash")
unless populated
puts 'Initializing git submodule'
system("cd #{neptuno_path}/services/#{service} 2>/dev/null && git submodule update --init --recursive #{neptuno_path}/services/#{service}")
end
puts current_branch
system("cd #{neptuno_path}/services/#{service} 2>/dev/null && git add . && git stash save -u -q neptuno_stash")
`cd #{neptuno_path}/services/#{service} 2>/dev/null && git checkout main 2>/dev/null`
`cd #{neptuno_path}/services/#{service} 2>/dev/null && git checkout master 2>/dev/null`
system("cd #{neptuno_path}/services/#{service} 2>/dev/null && git pull")
Expand Down
9 changes: 9 additions & 0 deletions lib/neptuno/tty/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ def neptuno_path

def make_service_files(services)
services.each do |service|
`cd #{neptuno_path}/services/#{service} 2>/dev/null`
if $?.exitstatus.zero?
`cd #{neptuno_path}/services/#{service} 2>/dev/null && git add . 2>/dev/null`
unless $?.exitstatus.zero?
`cd #{neptuno_path}/services/#{service} 2>/dev/null && git submodule update --init --recursive #{neptuno_path}/services/#{service}`
`cd #{neptuno_path}/services/#{service} 2>/dev/null && git checkout main 2>/dev/null`
`cd #{neptuno_path}/services/#{service} 2>/dev/null && git checkout master 2>/dev/null`
end
end
`cd #{neptuno_path} && mkdir -p environments/#{service} procfiles/#{service} dockerfiles/#{service}`
`cd #{neptuno_path} && touch environments/#{service}/default`
`cd #{neptuno_path} && touch dockerfiles/#{service}/Dockerfile`
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.9'
VERSION = '1.4.10'
end

0 comments on commit 538c5d1

Please sign in to comment.