dapp 0.5.4 → 0.5.5

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: e5d017933da4768131f34525742c26e604a39e3b
4
- data.tar.gz: 121c7b049d68ca081245e026f68884f149f73a62
3
+ metadata.gz: 736bd0b9c90721b086654095099165858735d7b7
4
+ data.tar.gz: b35661d57687c80f77b802895e1b1266c03e0604
5
5
  SHA512:
6
- metadata.gz: 88cf75c2621ccdaa2d7c80b93e9685c32bb422841e05c0a1e5443aa6827e79ad59a05796fe8e17b810c055d8b55eece239098e36026b093bef86634deb2305d5
7
- data.tar.gz: 0120e75385c0043bb9d16e3a97b99f8f6a667a394d09f75bb738a430488b3fef91c4abfbc0693cd9ec3d600b46e9fe8b1c538063df6e2f98dfd759266d3fac07
6
+ metadata.gz: 46ccabca9ea0395b300257d38b010e9b0f00a158a403f8142b4c53c25c643520d88c2d080c6ea0d30f3b01e91136f4dfd304685cbd04ba81b71f942c8ba69d6c
7
+ data.tar.gz: 4009d71698dddb250b37bc0d14dccbd2632bcc28a207920aed6520b3830f5054f9f61474e21a4741ee26a31ec871beacf08b28e5588bfe3469ad09aeefdefaf0
@@ -9,7 +9,7 @@ en:
9
9
  git_branch_without_name: "Application has specific revision that isn't associated with a branch name!"
10
10
  ci_environment_required: 'CI environment required (Travis or GitLab CI)!'
11
11
  dappfile:
12
- incorrect: "Dappfile '%{path}' with '%{error}':\n%{message}"
12
+ incorrect: "Dappfile with '%{error}':\n%{message}"
13
13
  build:
14
14
  from_image_required: 'Missing from_image!'
15
15
  image_already_untagged: "Image `%{name}` already untagged!"
@@ -27,5 +27,6 @@ en:
27
27
  docker_from_not_defined: "Docker `from` not defined!"
28
28
  artifact_unexpected_attribute: "Artifact doesn't has attribute '%{attr}'!"
29
29
  git_artifact_unexpected_attribute: "'%{type}' git artifact doesn't has attribute '%{attr}'!"
30
+ app_name_incorrect: "Application has incorrect name '%{name}': doesn't match regex '%{reg}'!"
30
31
  chef:
31
32
  stage_path_overlap: "Cannot install '%{cookbook}' cookbook's path %{from} into %{to}: already exists"
@@ -76,7 +76,7 @@ module Dapp
76
76
  elsif application.dry_run?
77
77
  application.log_state(name, state: application.t(code: 'state.build'), styles: { status: :success })
78
78
  else
79
- application.log_process(name, process: application.t(code: 'status.process.building'), short: should_be_not_detailed?) do
79
+ application.log_process(name, process: application.t(code: 'status.process.building'), short: should_not_be_detailed?) do
80
80
  image_do_build
81
81
  end
82
82
  end
@@ -51,12 +51,7 @@ module Dapp
51
51
  image.tagged? && !application.log_verbose? && application.cli_options[:introspect_stage].nil?
52
52
  end
53
53
 
54
- def should_be_not_present?
55
- return false if next_stage.nil?
56
- next_stage.image.tagged? || next_stage.should_be_not_present?
57
- end
58
-
59
- def should_be_not_detailed?
54
+ def should_not_be_detailed?
60
55
  image.send(:bash_commands).empty?
61
56
  end
62
57
 
@@ -67,7 +67,7 @@ module Dapp
67
67
  end
68
68
  end
69
69
 
70
- def should_be_not_detailed?
70
+ def should_not_be_detailed?
71
71
  true
72
72
  end
73
73
 
@@ -71,7 +71,10 @@ module Dapp
71
71
  end
72
72
 
73
73
  def _name
74
- @_name || @_basename
74
+ (@_name || @_basename).tap do |name|
75
+ reg = '^[[[:alnum:]]_.-]*$'
76
+ raise Error::Config, code: :app_name_incorrect, data: { name: name, reg: reg } unless name =~ /#{reg}/
77
+ end
75
78
  end
76
79
 
77
80
  def _apps
@@ -82,11 +82,10 @@ module Dapp
82
82
  begin
83
83
  conf.instance_eval File.read(dappfile_path), dappfile_path
84
84
  rescue SyntaxError, StandardError => e
85
- message = case e
86
- when ArgumentError then "#{e.backtrace.first[/`.*'$/]}: #{e.message}"
87
- else e.message
88
- end
89
- raise Error::Dappfile, code: :incorrect, data: { error: e.class.name, path: dappfile_path, message: message }
85
+ backtrace = e.backtrace.find { |line| line.start_with?(dappfile_path) }
86
+ message = e.is_a?(NoMethodError) ? e.message[/.*(?= for)/] : e.message
87
+ message = "#{backtrace[/.*(?=:in)/]}: #{message}" if backtrace
88
+ raise Error::Dappfile, code: :incorrect, data: { error: e.class.name, message: message }
90
89
  end
91
90
  end
92
91
  config._apps.select { |app| app_filters.any? { |pattern| File.fnmatch(pattern, app._name) } }
@@ -92,7 +92,7 @@ module Dapp
92
92
  end
93
93
 
94
94
  def diff_command(from, to, quiet: false)
95
- "diff #{'--quiet' if quiet} #{from}..#{to} #{"--relative=#{cwd}" if cwd} -- #{paths(true)}"
95
+ "diff --binary --full-index #{'--quiet' if quiet} #{from}..#{to} #{"--relative=#{cwd}" if cwd} -- #{paths(true)}"
96
96
  end
97
97
  end
98
98
  end
@@ -1,5 +1,5 @@
1
1
  # Version
2
2
  module Dapp
3
- VERSION = '0.5.4'.freeze
4
- BUILD_CACHE_VERSION = 2
3
+ VERSION = '0.5.5'.freeze
4
+ BUILD_CACHE_VERSION = 3
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-17 00:00:00.000000000 Z
11
+ date: 2016-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout