neptuno 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef3b2c4cec926bee8940257c245948e7b52a7e69
4
- data.tar.gz: f6c1a91eb8f8a95ba782a6827c692a4de125ba2e
3
+ metadata.gz: 294ecbcd067c63dc56c264f49ed2338f0c625881
4
+ data.tar.gz: 91bca6f7898526f3e314a589ac6dc698f5b14156
5
5
  SHA512:
6
- metadata.gz: 386cb5eec9ce1b87aebc94186833740c3ca44d676c62d736f576bf4dc6644a6178a83555cb9161d865ce2f3aed2e131a11c1035e6f6f3fd11899223d28e24251
7
- data.tar.gz: 1158f4fc99af42bd9497887ef2511f2630c6ea639d3009f6562358148768e410bcc93a60b521f914c5cc219b02dc58f5eeffd5f85c7df0374ece27452569d254
6
+ metadata.gz: 6e6caa3d090c78e0787894086a95c0fa23f6be37fa814570bf70004f4c5dadfbc6500a0a21163cc57264ac806c4ebb6884c8fd9b103c3170a0eefa1845ef5ee1
7
+ data.tar.gz: 5534e7dcc424c14ec5ae852a0122c32c72b1315faeffc6a9e23df32979a52f819d4cfa46d2e281d51689c1c5036ca6171b45b1062b2c81242b8d4f6352dad15f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neptuno (1.2.0)
4
+ neptuno (1.2.1)
5
5
  dotiw
6
6
  dry-cli
7
7
  hirb
@@ -4,16 +4,16 @@ module Neptuno
4
4
  module Docker
5
5
  # Build docker container for Neptuno project
6
6
  class Up < Neptuno::CLI::Base
7
- desc "Docker: bring up docker containers for current project"
7
+ desc 'Docker: bring up docker containers for current project'
8
8
 
9
- option :all, type: :boolean, default: false, desc: "Run on all services"
10
- option :wait, type: :boolean, default: true, desc: "Wait for services to be healthy"
11
- argument :services, type: :array, required: false, desc: "Optional list of services"
9
+ option :all, type: :boolean, default: false, desc: 'Run on all services'
10
+ option :wait, type: :boolean, default: true, desc: 'Wait for services to be healthy'
11
+ argument :services, type: :array, required: false, desc: 'Optional list of services'
12
12
 
13
13
  def call(services: [], **options)
14
- command_services_to("come up", all: options.fetch(:all), services_as_args: services) do |services, _project|
14
+ command_services_to('come up', all: options.fetch(:all), services_as_args: services) do |services, _project|
15
15
  make_service_files(services)
16
- system("cd #{neptuno_path} && docker-compose up -d --wait #{services.join(" ")}")
16
+ system("cd #{neptuno_path} && docker compose up -d --wait #{services.join(' ')}")
17
17
  end
18
18
  end
19
19
  end
@@ -6,9 +6,9 @@ module Neptuno
6
6
  module Config
7
7
  include TTY::File
8
8
  TTY = ::TTY::Config.new
9
- TTY.filename = "neptuno"
9
+ TTY.filename = 'neptuno'
10
10
 
11
- ABORT_MESSAGE = "fatal: there are no registered services. Add one with: neptuno services add"
11
+ ABORT_MESSAGE = 'fatal: there are no registered services. Add one with: neptuno services add'
12
12
 
13
13
  def config
14
14
  TTY
@@ -25,11 +25,11 @@ module Neptuno
25
25
  end
26
26
 
27
27
  def docker_compose_services
28
- docker_compose_hash.fetch("services").keys.sort
28
+ docker_compose_hash.fetch('services').keys.sort
29
29
  end
30
30
 
31
31
  def auto_restart_procs
32
- config.fetch("auto_restart_procs")
32
+ config.fetch('auto_restart_procs')
33
33
  end
34
34
 
35
35
  def services
@@ -39,16 +39,16 @@ module Neptuno
39
39
  end
40
40
 
41
41
  def configured_services
42
- config.fetch("configured_services")
42
+ config.fetch('configured_services')
43
43
  end
44
44
 
45
45
  def running_services
46
- `cd #{neptuno_path} && docker-compose ps --status running --services`.split
46
+ `cd #{neptuno_path} && docker compose ps --status running --services`.split
47
47
  end
48
48
 
49
49
  def json_services_status
50
50
  JSON.parse(`cd #{neptuno_path} && docker compose ps --all --format json`).map do |service|
51
- [service.dig("Service"), service.dig("Status")]
51
+ [service.dig('Service'), service.dig('Status')]
52
52
  end
53
53
  end
54
54
 
@@ -63,13 +63,13 @@ module Neptuno
63
63
  end
64
64
 
65
65
  def services_with_procs
66
- `cd #{neptuno_path} && find procfiles -type f -size +0`.split.map { |x| x.split("/")[1] }
66
+ `cd #{neptuno_path} && find procfiles -type f -size +0`.split.map { |x| x.split('/')[1] }
67
67
  end
68
68
 
69
69
  def get_dependants(services = [])
70
70
  return [] if services.empty?
71
71
 
72
- deps = services.map { |service| docker_compose_hash.dig("services", service, "depends_on") }.flatten.uniq
72
+ deps = services.map { |service| docker_compose_hash.dig('services', service, 'depends_on') }.flatten.uniq
73
73
  [deps, get_dependants(deps - services)].flatten.compact.uniq
74
74
  end
75
75
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Neptuno
4
- VERSION = "1.2.0"
4
+ VERSION = "1.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neptuno
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Plancarte