dapp 0.30.0 → 0.30.1

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: 259d9afe89f767678121d96c8ef2b64c1521207c
4
- data.tar.gz: 667396adfa0c4f566621b4ed577636e1e82df25a
3
+ metadata.gz: ac16a9c84e2d3af89ad9a59a0aa51f7073c09552
4
+ data.tar.gz: 5efbf94424686ef128e7d3d14e4ec34fd001b8ad
5
5
  SHA512:
6
- metadata.gz: 434fe4c12cdc155d0ce888cce71948ac9fdf29daafcc8327d64d7649b78df948205ea76a2ee777488e1d12f32273178f5e7f03a64671cb5727b3bb207dd91cef
7
- data.tar.gz: 97a9dc7ae4e16c42cb1e9002e8eff1dc90d572a013288638b2fc61a124862d37b5089f4f0d7afec841fdfa0413aba323033922b5ba54e8f002bda9cdcd030ed7
6
+ metadata.gz: 2ab041b8537358ccc8137f7d737d343ab46debcd7fe128e269f7672f99bb479e4f2aef120d7373dc5d0c013008c46c83bfc2817b554f1a5e03d84cb2fbc67c29
7
+ data.tar.gz: 65dde18c5f79aa88fc1f3f16af037ab377cb463e4ee5f59a5df7118a026060878033d603d18d7c9ebdab47f2afd05c0c5c635aaebe878d63bc9e450fda29e2a1
@@ -27,10 +27,6 @@ BANNER
27
27
  description: 'Redefine resource locking timeout (in seconds)',
28
28
  proc: ->(v) { v.to_i }
29
29
 
30
- option :git_artifact_branch,
31
- long: '--git-artifact-branch BRANCH',
32
- description: 'Default branch to archive artifacts from'
33
-
34
30
  option :build_context_directory,
35
31
  long: '--build-context-directory DIR_PATH',
36
32
  default: nil
@@ -24,10 +24,6 @@ BANNER
24
24
  description: 'Redefine resource locking timeout (in seconds)',
25
25
  proc: ->(v) { v.to_i }
26
26
 
27
- option :git_artifact_branch,
28
- long: '--git-artifact-branch BRANCH',
29
- description: 'Default branch to archive artifacts from'
30
-
31
27
  option :build_context_directory,
32
28
  long: '--build-context-directory DIR_PATH',
33
29
  default: nil
@@ -18,10 +18,6 @@ BANNER
18
18
  description: 'Redefine resource locking timeout (in seconds)',
19
19
  proc: ->(v) { v.to_i }
20
20
 
21
- option :git_artifact_branch,
22
- long: '--git-artifact-branch BRANCH',
23
- description: 'Default branch to archive artifacts from'
24
-
25
21
  option :with_stages,
26
22
  long: '--with-stages',
27
23
  boolean: true
@@ -2,30 +2,30 @@ module Dapp
2
2
  module Dimg
3
3
  class Dimg
4
4
  module GitArtifact
5
- def git_artifacts
6
- [*local_git_artifacts, *remote_git_artifacts].compact
5
+ def git_artifacts(omit_empty: true)
6
+ [*local_git_artifacts(omit_empty: omit_empty), *remote_git_artifacts(omit_empty: omit_empty)].compact
7
7
  end
8
8
 
9
- def local_git_artifacts
9
+ def local_git_artifacts(omit_empty: true)
10
10
  @local_git_artifact_list ||= [].tap do |artifacts|
11
11
  break artifacts if (local_git_artifacts = Array(config._git_artifact._local)).empty?
12
12
  repo = GitRepo::Own.new(dapp)
13
13
  local_git_artifacts.map do |ga_config|
14
- artifacts.concat(generate_git_artifacts(repo, **ga_config._artifact_options))
14
+ artifacts.concat(generate_git_artifacts(repo, omit_empty: omit_empty, **ga_config._artifact_options))
15
15
  end unless repo.empty?
16
16
  end
17
17
  end
18
18
 
19
- def remote_git_artifacts
19
+ def remote_git_artifacts(omit_empty: true)
20
20
  @remote_git_artifact_list ||= [].tap do |artifacts|
21
21
  Array(config._git_artifact._remote).each do |ga_config|
22
22
  repo = GitRepo::Remote.get_or_create(dapp, ga_config._name, url: ga_config._url, ignore_git_fetch: ignore_git_fetch)
23
- artifacts.concat(generate_git_artifacts(repo, **ga_config._artifact_options)) unless repo.empty?
23
+ artifacts.concat(generate_git_artifacts(repo, omit_empty: omit_empty, **ga_config._artifact_options)) unless repo.empty?
24
24
  end
25
25
  end
26
26
  end
27
27
 
28
- def generate_git_artifacts(repo, **git_artifact_options)
28
+ def generate_git_artifacts(repo, omit_empty: true, **git_artifact_options)
29
29
  [].tap do |artifacts|
30
30
  artifacts << (artifact = ::Dapp::Dimg::GitArtifact.new(repo, self, ignore_signature_auto_calculation: ignore_signature_auto_calculation, **git_artifact_options))
31
31
  if ENV['DAPP_DISABLE_GIT_SUBMODULES']
@@ -34,7 +34,7 @@ module Dapp
34
34
  artifacts.concat(generate_git_embedded_artifacts(artifact))
35
35
  end
36
36
  end.select do |artifact|
37
- !artifact.empty?
37
+ !omit_empty || !artifact.empty?
38
38
  end
39
39
  end
40
40
 
@@ -21,7 +21,7 @@ module Dapp
21
21
 
22
22
  @ignore_signature_auto_calculation = ignore_signature_auto_calculation
23
23
 
24
- @branch = branch || repo.dapp.options[:git_artifact_branch] || repo.branch
24
+ @branch = branch || repo.branch
25
25
  @commit = commit
26
26
 
27
27
  @to = to
@@ -96,7 +96,7 @@ module Dapp
96
96
  dimg_data["docker_image"] = [[repo, dimg.name].compact.join("/"), docker_tag].join(":")
97
97
  dimg_data["docker_image_id"] = docker_image_id
98
98
 
99
- [*dimg.local_git_artifacts, *dimg.remote_git_artifacts].each do |ga|
99
+ dimg.git_artifacts(omit_empty: false).each do |ga|
100
100
  if ga.as
101
101
  commit_id = dimg_labels[dapp.dimgstage_g_a_commit_label(ga.paramshash)] || TEMPLATE_EMPTY_VALUE
102
102
 
@@ -7,10 +7,10 @@ module Dapp
7
7
 
8
8
  class << self
9
9
  def new_auto_if_available
10
- if ENV['KUBECONFIG']
11
- Kubernetes::Config.new_from_kubeconfig(ENV['KUBECONFIG'])
12
- elsif Kubernetes::Config.kubectl_available?
10
+ if Kubernetes::Config.kubectl_available?
13
11
  Kubernetes::Config.new_from_kubectl
12
+ elsif ENV['KUBECONFIG']
13
+ Kubernetes::Config.new_from_kubeconfig(ENV['KUBECONFIG'])
14
14
  else
15
15
  default_path = File.join(ENV['HOME'], '.kube/config')
16
16
  if File.exists? default_path
@@ -43,11 +43,14 @@ module Dapp
43
43
  end
44
44
 
45
45
  def new_from_kubectl
46
- cmd_res = shellout("kubectl config view")
46
+ cmd_res = shellout(
47
+ "kubectl config view --raw",
48
+ env: {"KUBECONFIG" => ENV["KUBECONFIG"]}
49
+ )
47
50
 
48
51
  shellout_cmd_should_succeed! cmd_res
49
52
 
50
- self.new YAML.load(cmd_res.stdout), "kubectl config view"
53
+ self.new YAML.load(cmd_res.stdout), "kubectl config view --raw"
51
54
  end
52
55
  end # << self
53
56
 
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = "0.30.0"
2
+ VERSION = "0.30.1"
3
3
  BUILD_CACHE_VERSION = 30
4
4
  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.30.0
4
+ version: 0.30.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-26 00:00:00.000000000 Z
11
+ date: 2018-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout