chagall 0.0.1.beta6 → 0.0.1.beta7

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
  SHA256:
3
- metadata.gz: f3cbd29143d65c6c6713ea03e0e26a29d7bb520139638cec49467fa932a1915d
4
- data.tar.gz: 3c758792a4a406ff7981de63eae1512602b2b41184ce1c68ea00c1aa369dfcd3
3
+ metadata.gz: 4f8df566c5608a68224f0cda8ee7ec4dc2ad6b9c3657476052271c033104ccc5
4
+ data.tar.gz: fc9fdbd3a3c2035459d7239a9f245a030df45994bd7b1346dbed62a735014493
5
5
  SHA512:
6
- metadata.gz: 53637eb5f31edfd125b9a14c844e888f316e8914a5bfd817eea97e60ae9e5cd5d5b3619f7f1cee2af1421b6ccf4c2e903845bb95cd70a7eaf9d7537312ef0447
7
- data.tar.gz: 51b246cc1a5e21171552f56bae8e1b9b4f179468369613de76d7c0e45cf37e8a67b048f63d61248f0deaeb0cc9316ace2d46ad506ff2f516dfd5206ad777b227
6
+ metadata.gz: 1cb86c45fe1af47f7c8791ed73025903ae5338ecfaee7b6b287c96b4959fa21670f5677cbc228715e4949603329601d0a8fe4fe2584d15090206830b526908ca
7
+ data.tar.gz: 5b9cd2bb23766a47c6f1727dcd4a04d4c068fdbdeec942115adfa11aac01ac739b131c1314156f201db2a5868d24ae0ae396b1f9b41fa720f1e52f0691c6ddb4
data/lib/chagall/base.rb CHANGED
@@ -9,9 +9,9 @@ module Chagall
9
9
  "info" => Logger::INFO,
10
10
  "debug" => Logger::DEBUG,
11
11
  "warn" => Logger::WARN,
12
- "error" => Logger::ERROR,
12
+ "error" => Logger::ERROR
13
13
  }
14
-
14
+
15
15
  def logger
16
16
  @logger ||= Logger.new($stdout).tap do |l|
17
17
  l.formatter = proc do |severity, _, _, msg|
data/lib/chagall/cli.rb CHANGED
@@ -10,13 +10,12 @@ Clamp.allow_options_after_parameters = true
10
10
 
11
11
  module Chagall
12
12
  class Cli < Clamp::Command
13
-
14
13
  def run(arguments)
15
14
  parse(arguments)
16
15
  Chagall::Settings.configure(collect_options_hash)
17
16
  execute
18
17
  end
19
-
18
+
20
19
  def self.options_from_config_file
21
20
  @options_from_config_file ||= begin
22
21
  config_path = File.join(Dir.pwd, "chagall.yml") || File.join(Dir.pwd, "chagall.yaml")
@@ -7,7 +7,6 @@ require "yaml"
7
7
 
8
8
  module Chagall
9
9
  class Deploy < Base
10
-
11
10
  attr_reader :total_time
12
11
 
13
12
  def execute
@@ -253,6 +252,6 @@ module Chagall
253
252
 
254
253
  def ssh
255
254
  @ssh ||= SSH.new
256
- end
255
+ end
257
256
  end
258
257
  end
@@ -1,3 +1,3 @@
1
1
  module Chagall
2
- VERSION = "0.0.1.beta6"
2
+ VERSION = "0.0.1.beta7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chagall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta6
4
+ version: 0.0.1.beta7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Klevtsov
@@ -94,7 +94,6 @@ files:
94
94
  - lib/chagall/base.rb
95
95
  - lib/chagall/cli.rb
96
96
  - lib/chagall/compose.rb
97
- - lib/chagall/compose/main.rb
98
97
  - lib/chagall/deploy.rb
99
98
  - lib/chagall/install/main.rb
100
99
  - lib/chagall/install/templates/template.Dockerfile
@@ -1,52 +0,0 @@
1
- require_relative "../base"
2
-
3
- module Chagall
4
- module Compose
5
- class Main < Base
6
- attr_reader :command, :service, :args
7
-
8
- def initialize(command, *args)
9
- @command = command
10
- @service = args.first if args.first && !args.first.start_with?('-')
11
- @args = @service ? args[1..-1] : args
12
-
13
- raise Chagall::Error, "Command is required" if @command.nil? || @command.empty?
14
-
15
- run_command
16
- end
17
-
18
- private
19
-
20
- def run_command
21
- cmd = build_command
22
- logger.debug "Executing: #{cmd}"
23
-
24
- result = ssh.execute(cmd, tty: true)
25
- raise Chagall::Error, "Command failed: #{cmd}" unless result
26
- end
27
-
28
- def build_command
29
- cmd = [ "cd #{Settings.instance.project_folder_path}" ]
30
- cmd << build_docker_compose_command
31
- cmd << @command
32
- cmd << @service if @service
33
- cmd << @args.join(" ") if @args && @args.any?
34
-
35
- cmd.join(" && ")
36
- end
37
-
38
- def build_docker_compose_command
39
- compose_files = Settings[:compose_files]
40
- compose_cmd = [ "docker compose" ]
41
-
42
- if compose_files && !compose_files.empty?
43
- compose_files.each do |file|
44
- compose_cmd << "-f #{File.basename(file)}"
45
- end
46
- end
47
-
48
- compose_cmd.join(" ")
49
- end
50
- end
51
- end
52
- end