dapp 0.21.5 → 0.21.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/en/net_status.yml +1 -0
- data/lib/dapp.rb +4 -0
- data/lib/dapp/dapp/option_tags.rb +31 -24
- data/lib/dapp/dimg/build/stage/base.rb +0 -3
- data/lib/dapp/dimg/cli/command/dimg.rb +4 -2
- data/lib/dapp/dimg/cli/command/dimg/cleanup_repo.rb +30 -0
- data/lib/dapp/dimg/cli/command/dimg/flush_repo.rb +30 -0
- data/lib/dapp/dimg/dapp/command/cleanup_repo.rb +71 -0
- data/lib/dapp/dimg/dapp/command/common.rb +4 -0
- data/lib/dapp/dimg/dapp/command/flush_repo.rb +19 -0
- data/lib/dapp/dimg/dapp/command/push.rb +0 -7
- data/lib/dapp/dimg/dapp/command/stages/cleanup_local.rb +1 -1
- data/lib/dapp/dimg/dapp/command/stages/cleanup_repo.rb +2 -2
- data/lib/dapp/dimg/dapp/command/stages/common.rb +1 -1
- data/lib/dapp/dimg/dapp/command/stages/flush_repo.rb +2 -5
- data/lib/dapp/dimg/dapp/dapp.rb +2 -0
- data/lib/dapp/dimg/dimg.rb +12 -6
- data/lib/dapp/dimg/docker_registry/base/authorization.rb +5 -5
- data/lib/dapp/dimg/docker_registry/dimg.rb +5 -0
- data/lib/dapp/dimg/git_repo/base.rb +11 -0
- data/lib/dapp/dimg/image/stage.rb +15 -0
- data/lib/dapp/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e7d9a0dc7f56238457f89d9892f39a6f3e420d11fc67f575413248c44e105fa
|
4
|
+
data.tar.gz: a78133ee132bbef279c05cdcaf313dd09decd9e20eeb93325034cfd95979b69f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26138b6f38fe585774aa434b42379473d08b08663a9242d894201236ef1a5738f6ef0dfda78f62c61431b7794e54f1a16af7a325b322b7d565bcd3a381d8728d
|
7
|
+
data.tar.gz: bc959e938bee49762ef4711c3af7e6cc4205b1ccf520dd6f214c48670a0f6a01aec4da5572cdb97c6d770071daed7ee7ec2842f34c86fb61caec712afcc45948
|
data/config/en/net_status.yml
CHANGED
@@ -21,6 +21,7 @@ en:
|
|
21
21
|
command:
|
22
22
|
command_unexpected_dimgs_number: "Command can process only one dimg!\nAmbiguous dimg pattern: `%{dimgs_names}`!"
|
23
23
|
mrproper_required_option: "Expected command option `--improper-dev-mode-cache`, `--improper-cache-version-stages` or `--all`!"
|
24
|
+
cleanup_repo_required_option: "Expected command option `--improper-nonexistent-git-tag-branch-commit`!"
|
24
25
|
stages_cleanup_required_option: "Expected command option `--improper-cache-version`, `--improper-git-commit` or `--improper-repo-cache`!"
|
25
26
|
repo_name_incorrect: "Incorrect repo name `%{name}` given!"
|
26
27
|
image_name_incorrect: "Incorrect image name `%{name}` given!"
|
data/lib/dapp.rb
CHANGED
@@ -207,6 +207,8 @@ require 'dapp/dimg/cli/command/dimg/stages/cleanup_repo'
|
|
207
207
|
require 'dapp/dimg/cli/command/dimg/stages/push'
|
208
208
|
require 'dapp/dimg/cli/command/dimg/stages/pull'
|
209
209
|
require 'dapp/dimg/cli/command/dimg/run'
|
210
|
+
require 'dapp/dimg/cli/command/dimg/cleanup_repo'
|
211
|
+
require 'dapp/dimg/cli/command/dimg/flush_repo'
|
210
212
|
require 'dapp/dimg/cli/command/dimg/cleanup'
|
211
213
|
require 'dapp/dimg/cli/command/dimg/bp'
|
212
214
|
require 'dapp/dimg/cli/command/dimg/mrproper'
|
@@ -235,6 +237,8 @@ require 'dapp/dimg/config/config'
|
|
235
237
|
require 'dapp/dimg/dapp/command/common'
|
236
238
|
require 'dapp/dimg/dapp/command/build'
|
237
239
|
require 'dapp/dimg/dapp/command/bp'
|
240
|
+
require 'dapp/dimg/dapp/command/cleanup_repo'
|
241
|
+
require 'dapp/dimg/dapp/command/flush_repo'
|
238
242
|
require 'dapp/dimg/dapp/command/cleanup'
|
239
243
|
require 'dapp/dimg/dapp/command/mrproper'
|
240
244
|
require 'dapp/dimg/dapp/command/stage_image'
|
@@ -5,32 +5,37 @@ module Dapp
|
|
5
5
|
@git_repo ||= ::Dapp::Dimg::GitRepo::Own.new(self)
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
9
|
-
@
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
def tags_by_scheme
|
9
|
+
@tags_by_scheme_name ||= begin
|
10
|
+
[simple_tags, branch_tags, commit_tags, build_tags, ci_tags].reduce({}) do |some_tags_by_scheme, tags_by_scheme|
|
11
|
+
tags_by_scheme.in_depth_merge(some_tags_by_scheme)
|
12
|
+
end.tap do |tags_by_scheme|
|
13
|
+
tags_by_scheme[:custom] = [:latest] if tags_by_scheme.values.flatten.empty?
|
14
|
+
end
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
18
|
+
def option_tags
|
19
|
+
tags_by_scheme.values.flatten
|
20
|
+
end
|
21
|
+
|
16
22
|
def simple_tags
|
17
|
-
options[:tag]
|
23
|
+
{ custom: options[:tag] }
|
18
24
|
end
|
19
25
|
|
20
26
|
def branch_tags
|
21
|
-
return
|
27
|
+
return {} unless options[:tag_branch]
|
22
28
|
raise Error::Dapp, code: :git_branch_without_name if (branch = git_local_repo.branch) == 'HEAD'
|
23
|
-
[branch]
|
29
|
+
{ git_branch: [branch] }
|
24
30
|
end
|
25
31
|
|
26
32
|
def commit_tags
|
27
|
-
return
|
28
|
-
|
29
|
-
[commit]
|
33
|
+
return {} unless options[:tag_commit]
|
34
|
+
{ git_commit: [git_local_repo.latest_commit] }
|
30
35
|
end
|
31
36
|
|
32
37
|
def build_tags
|
33
|
-
return
|
38
|
+
return {} unless options[:tag_build_id]
|
34
39
|
|
35
40
|
if ENV['GITLAB_CI']
|
36
41
|
build_id = ENV['CI_BUILD_ID']
|
@@ -40,23 +45,25 @@ module Dapp
|
|
40
45
|
raise Error::Dapp, code: :ci_environment_required
|
41
46
|
end
|
42
47
|
|
43
|
-
[build_id]
|
48
|
+
{ ci: [build_id] }
|
44
49
|
end
|
45
50
|
|
46
51
|
def ci_tags
|
47
|
-
return
|
52
|
+
return {} unless options[:tag_ci]
|
48
53
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
{}.tap do |tags_by_scheme|
|
55
|
+
if ENV['GITLAB_CI']
|
56
|
+
tags_by_scheme[:git_branch] = [ENV['CI_BUILD_REF_NAME']]
|
57
|
+
tags_by_scheme[:git_tag] = [ENV['CI_BUILD_TAG']]
|
58
|
+
elsif ENV['TRAVIS']
|
59
|
+
tags_by_scheme[:git_branch] = [ENV['TRAVIS_BRANCH']]
|
60
|
+
tags_by_scheme[:git_tag] = [ENV['TRAVIS_TAG']]
|
61
|
+
else
|
62
|
+
raise Error::Dapp, code: :ci_environment_required
|
63
|
+
end
|
58
64
|
|
59
|
-
|
65
|
+
tags_by_scheme.delete_if { |_, tags| tags.first.nil? }
|
66
|
+
end
|
60
67
|
end
|
61
68
|
end # Tags
|
62
69
|
end # Dapp
|
@@ -81,9 +81,6 @@ module Dapp
|
|
81
81
|
def prepare_image
|
82
82
|
return if dimg.dapp.dry_run?
|
83
83
|
|
84
|
-
image.add_volumes_from dimg.dapp.toolchain_container
|
85
|
-
image.add_volumes_from dimg.dapp.base_container
|
86
|
-
|
87
84
|
image_add_mounts
|
88
85
|
|
89
86
|
image.add_service_change_label dapp: dimg.stage_dapp_label
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Dapp::Dimg::CLI
|
2
2
|
module Command
|
3
3
|
class Dimg < ::Dapp::CLI
|
4
|
-
SUBCOMMANDS = ['build', 'push', 'spush', 'list', 'run', 'stages', 'cleanup', 'bp', 'mrproper', 'stage image', 'tag', 'build-context'].freeze
|
4
|
+
SUBCOMMANDS = ['build', 'push', 'spush', 'list', 'run', 'stages', 'cleanup', 'bp', 'mrproper', 'stage image', 'tag', 'build-context', 'cleanup repo', 'flush repo'].freeze
|
5
5
|
|
6
6
|
banner <<BANNER.freeze
|
7
7
|
Usage: dapp dimg [options] subcommand [subcommand options]
|
@@ -15,7 +15,9 @@ Available subcommands: (for details, dapp dimg SUB-COMMAND --help)
|
|
15
15
|
dapp dimg tag [options] [DIMG] TAG
|
16
16
|
dapp dimg list [options] [DIMG ...]
|
17
17
|
dapp dimg run [options] [DIMG] [DOCKER ARGS]
|
18
|
-
dapp dimg cleanup [options] [DIMG ...]
|
18
|
+
dapp dimg cleanup repo [options] [DIMG ...] REPO
|
19
|
+
dapp dimg flush repo [options] [DIMG ...] REPO
|
20
|
+
dapp dimg cleanup [options]
|
19
21
|
dapp dimg mrproper [options]
|
20
22
|
dapp dimg stage image [options] [DIMG]
|
21
23
|
dapp dimg stages
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Dapp::Dimg::CLI
|
2
|
+
module Command
|
3
|
+
class Dimg < ::Dapp::CLI
|
4
|
+
class CleanupRepo < Base
|
5
|
+
banner <<BANNER.freeze
|
6
|
+
Usage:
|
7
|
+
|
8
|
+
dapp dimg cleanup repo [options] [DIMG ...] REPO
|
9
|
+
|
10
|
+
Options:
|
11
|
+
BANNER
|
12
|
+
|
13
|
+
option :lock_timeout,
|
14
|
+
long: '--lock-timeout TIMEOUT',
|
15
|
+
description: 'Redefine resource locking timeout (in seconds)',
|
16
|
+
proc: ->(v) { v.to_i }
|
17
|
+
|
18
|
+
option :with_stages,
|
19
|
+
long: '--with-stages',
|
20
|
+
boolean: true
|
21
|
+
|
22
|
+
def run(argv = ARGV)
|
23
|
+
self.class.parse_options(self, argv)
|
24
|
+
repo = self.class.required_argument(self, 'repo')
|
25
|
+
run_dapp_command(run_method, options: cli_options(dimgs_patterns: cli_arguments, repo: repo))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Dapp::Dimg::CLI
|
2
|
+
module Command
|
3
|
+
class Dimg < ::Dapp::CLI
|
4
|
+
class FlushRepo < Base
|
5
|
+
banner <<BANNER.freeze
|
6
|
+
Usage:
|
7
|
+
|
8
|
+
dapp dimg flush repo [options] [DIMG ...] REPO
|
9
|
+
|
10
|
+
Options:
|
11
|
+
BANNER
|
12
|
+
|
13
|
+
option :lock_timeout,
|
14
|
+
long: '--lock-timeout TIMEOUT',
|
15
|
+
description: 'Redefine resource locking timeout (in seconds)',
|
16
|
+
proc: ->(v) { v.to_i }
|
17
|
+
|
18
|
+
option :with_stages,
|
19
|
+
long: '--with-stages',
|
20
|
+
boolean: true
|
21
|
+
|
22
|
+
def run(argv = ARGV)
|
23
|
+
self.class.parse_options(self, argv)
|
24
|
+
repo = self.class.required_argument(self, 'repo')
|
25
|
+
run_dapp_command(run_method, options: cli_options(dimgs_patterns: cli_arguments, repo: repo))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module Dapp
|
2
|
+
module Dimg
|
3
|
+
module Dapp
|
4
|
+
module Command
|
5
|
+
module CleanupRepo
|
6
|
+
def cleanup_repo
|
7
|
+
lock_repo(repo = option_repo) do
|
8
|
+
registry = registry(repo)
|
9
|
+
|
10
|
+
repo_detailed_dimgs_images(registry).select do |image|
|
11
|
+
case image[:labels]['dapp-tag-scheme']
|
12
|
+
when 'git_tag', 'git_branch', 'git_commit' then true
|
13
|
+
else false
|
14
|
+
end && !deployed_docker_images.include?([image[:dimg], image[:tag]].join(':'))
|
15
|
+
end.tap do |dimgs_images|
|
16
|
+
cleanup_repo_by_nonexistent_git_tag(registry, dimgs_images)
|
17
|
+
cleanup_repo_by_nonexistent_git_branch(registry, dimgs_images)
|
18
|
+
cleanup_repo_by_nonexistent_git_commit(registry, dimgs_images)
|
19
|
+
end
|
20
|
+
|
21
|
+
begin
|
22
|
+
registry.reset_cache
|
23
|
+
repo_dimgs = repo_dimgs_images(registry)
|
24
|
+
repo_dimgstages = repo_dimgstages_images(registry)
|
25
|
+
repo_dimgstages_cleanup(registry, repo_dimgs, repo_dimgstages)
|
26
|
+
end if with_stages?
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def cleanup_repo_by_nonexistent_git_tag(registry, dimgs_images)
|
31
|
+
cleanup_repo_by_nonexistent_git_base(dimgs_images, 'git_tag') do |dimg_image|
|
32
|
+
delete_repo_image(registry, dimg_image) unless git_local_repo.tags.include?(dimg_image[:tag])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def cleanup_repo_by_nonexistent_git_branch(registry, dimgs_images)
|
37
|
+
cleanup_repo_by_nonexistent_git_base(dimgs_images, 'git_branch') do |dimg_image|
|
38
|
+
delete_repo_image(registry, dimg_image) unless git_local_repo.remote_branches.include?(dimg_image[:tag])
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def cleanup_repo_by_nonexistent_git_commit(registry, dimgs_images)
|
43
|
+
cleanup_repo_by_nonexistent_git_base(dimgs_images, 'git_commit') do |dimg_image|
|
44
|
+
delete_repo_image(registry, dimg_image) unless git_local_repo.commit_exists?(dimg_image[:tag])
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def cleanup_repo_by_nonexistent_git_base(dimgs_images, dapp_tag_scheme)
|
49
|
+
log_step_with_indent(:"nonexistent #{dapp_tag_scheme.split('_').join(' ')}") do
|
50
|
+
dimgs_images
|
51
|
+
.select { |dimg_image| dimg_image[:labels]['dapp-tag-scheme'] == dapp_tag_scheme }
|
52
|
+
.each { |dimg_image| yield dimg_image }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def repo_detailed_dimgs_images(registry)
|
57
|
+
repo_dimgs_images(registry).each do |dimg|
|
58
|
+
image_history = registry.image_history(dimg[:tag], dimg[:dimg])
|
59
|
+
dimg[:parent] = image_history['container_config']['Image']
|
60
|
+
dimg[:labels] = image_history['config']['Labels']
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def deployed_docker_images
|
65
|
+
[]
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end # Dimg
|
71
|
+
end # Dapp
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Dapp
|
2
|
+
module Dimg
|
3
|
+
module Dapp
|
4
|
+
module Command
|
5
|
+
module FlushRepo
|
6
|
+
def flush_repo
|
7
|
+
lock_repo(repo = option_repo) do
|
8
|
+
log_step_with_indent(option_repo) do
|
9
|
+
registry = registry(repo)
|
10
|
+
repo_dimgs_images(registry).each { |repo_image| delete_repo_image(registry, repo_image) }
|
11
|
+
stages_flush_repo if with_stages?
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end # Dimg
|
19
|
+
end # Dapp
|
@@ -8,8 +8,8 @@ module Dapp
|
|
8
8
|
lock_repo(repo = option_repo) do
|
9
9
|
raise Error::Command, code: :stages_cleanup_required_option unless stages_cleanup_option?
|
10
10
|
|
11
|
-
registry
|
12
|
-
repo_dimgs
|
11
|
+
registry = registry(repo)
|
12
|
+
repo_dimgs = repo_dimgs_images(registry)
|
13
13
|
repo_dimgstages = repo_dimgstages_images(registry)
|
14
14
|
|
15
15
|
repo_dimgstages.delete_if { |dimgstage| repo_dimgs.any? { |dimg| dimgstage[:id] == dimg[:id] } } # ignoring stages with dimgs ids (v2)
|
@@ -7,11 +7,8 @@ module Dapp
|
|
7
7
|
def stages_flush_repo
|
8
8
|
lock_repo(option_repo) do
|
9
9
|
log_step_with_indent(option_repo) do
|
10
|
-
registry
|
11
|
-
|
12
|
-
repo_dimgstages = repo_dimgstages_images(registry)
|
13
|
-
|
14
|
-
repo_dimgs.concat(repo_dimgstages).each { |repo_image| delete_repo_image(registry, repo_image) }
|
10
|
+
registry = registry(option_repo)
|
11
|
+
repo_dimgstages_images(registry).each { |repo_image| delete_repo_image(registry, repo_image) }
|
15
12
|
end
|
16
13
|
end
|
17
14
|
end
|
data/lib/dapp/dimg/dapp/dapp.rb
CHANGED
@@ -19,6 +19,8 @@ module Dapp
|
|
19
19
|
include Command::Stages::Push
|
20
20
|
include Command::Stages::Pull
|
21
21
|
include Command::Stages::Common
|
22
|
+
include Command::CleanupRepo
|
23
|
+
include Command::FlushRepo
|
22
24
|
include Command::Cleanup
|
23
25
|
include Command::Mrproper
|
24
26
|
include Command::StageImage
|
data/lib/dapp/dimg/dimg.rb
CHANGED
@@ -61,9 +61,13 @@ module Dapp
|
|
61
61
|
|
62
62
|
def export!(repo, format:)
|
63
63
|
dapp.lock("#{dapp.name}.images", readonly: true) do
|
64
|
-
dapp.
|
65
|
-
|
66
|
-
|
64
|
+
dapp.tags_by_scheme.each do |tag_scheme_name, tags|
|
65
|
+
tags.each do |tag|
|
66
|
+
image_name = format(format, repo: repo, dimg_name: config._name, tag: tag)
|
67
|
+
export_base!(image_name) do
|
68
|
+
last_stage.image.export_dimg!(image_name, sheme_name: tag_scheme_name)
|
69
|
+
end
|
70
|
+
end
|
67
71
|
end
|
68
72
|
end
|
69
73
|
end
|
@@ -72,12 +76,14 @@ module Dapp
|
|
72
76
|
dapp.lock("#{dapp.name}.images", readonly: true) do
|
73
77
|
export_images.each do |image|
|
74
78
|
image_name = format(format, repo: repo, signature: image.name.split(':').last)
|
75
|
-
export_base!(
|
79
|
+
export_base!(image_name) do
|
80
|
+
image.export!(image_name)
|
81
|
+
end
|
76
82
|
end
|
77
83
|
end
|
78
84
|
end
|
79
85
|
|
80
|
-
def export_base!(
|
86
|
+
def export_base!(image_name)
|
81
87
|
if dapp.dry_run?
|
82
88
|
dapp.log_state(image_name, state: dapp.t(code: 'state.push'), styles: { status: :success })
|
83
89
|
else
|
@@ -85,7 +91,7 @@ module Dapp
|
|
85
91
|
::Dapp::Dimg::Image::Docker.reset_image_inspect(image_name)
|
86
92
|
|
87
93
|
dapp.log_process(image_name, process: dapp.t(code: 'status.process.pushing')) do
|
88
|
-
|
94
|
+
yield
|
89
95
|
end
|
90
96
|
end
|
91
97
|
end
|
@@ -4,12 +4,12 @@ module Dapp
|
|
4
4
|
class Base
|
5
5
|
module Authorization
|
6
6
|
def authorization_options(url)
|
7
|
-
@authorization_options ||= begin
|
7
|
+
(@authorization_options ||= {})[@repo_suffix] ||= begin
|
8
8
|
case authenticate_header = raw_request(url).headers['Www-Authenticate']
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
when /Bearer/ then { headers: { Authorization: "Bearer #{authorization_token(authenticate_header)}" } }
|
10
|
+
when /Basic/ then { headers: { Authorization: "Basic #{authorization_auth}" } }
|
11
|
+
when nil then {}
|
12
|
+
else raise Error::Registry, code: :authenticate_type_not_supported, data: { registry: api_url }
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -84,6 +84,17 @@ module Dapp
|
|
84
84
|
raise Error::Rugged, code: :git_repository_reference_error, data: { name: name, message: e.message.downcase }
|
85
85
|
end
|
86
86
|
|
87
|
+
def tags
|
88
|
+
git.tags.map { |t| t.name }
|
89
|
+
end
|
90
|
+
|
91
|
+
def remote_branches
|
92
|
+
git.branches
|
93
|
+
.map { |b| b.name }
|
94
|
+
.select { |b| b.start_with?('origin/') }
|
95
|
+
.map { |b| b.reverse.chomp('origin/'.reverse).reverse }
|
96
|
+
end
|
97
|
+
|
87
98
|
def commit_at(commit)
|
88
99
|
lookup_commit(commit).time.to_i
|
89
100
|
end
|
@@ -22,16 +22,31 @@ module Dapp
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def build!
|
25
|
+
add_build_service_volumes
|
25
26
|
run!
|
26
27
|
@built_id = commit!
|
27
28
|
ensure
|
28
29
|
dapp.shellout("#{dapp.host_docker} rm #{container_name}")
|
29
30
|
end
|
30
31
|
|
32
|
+
def add_build_service_volumes
|
33
|
+
add_volumes_from dapp.toolchain_container
|
34
|
+
add_volumes_from dapp.base_container
|
35
|
+
end
|
36
|
+
|
31
37
|
def built?
|
32
38
|
!built_id.nil?
|
33
39
|
end
|
34
40
|
|
41
|
+
def export_dimg!(name, sheme_name:)
|
42
|
+
self.class.new(name: name, dapp: dapp, from: self).tap do |image|
|
43
|
+
image.add_service_change_label(:'dapp-tag-scheme' => sheme_name)
|
44
|
+
image.add_service_change_label(:'dapp-dimg' => true)
|
45
|
+
image.build!
|
46
|
+
image.export!(name)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
35
50
|
def export!(name)
|
36
51
|
tag!(name).tap do |image|
|
37
52
|
image.push!
|
data/lib/dapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.
|
4
|
+
version: 0.21.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Stolyarov
|
@@ -534,6 +534,8 @@ files:
|
|
534
534
|
- lib/dapp/dimg/cli/command/dimg/build_context/export.rb
|
535
535
|
- lib/dapp/dimg/cli/command/dimg/build_context/import.rb
|
536
536
|
- lib/dapp/dimg/cli/command/dimg/cleanup.rb
|
537
|
+
- lib/dapp/dimg/cli/command/dimg/cleanup_repo.rb
|
538
|
+
- lib/dapp/dimg/cli/command/dimg/flush_repo.rb
|
537
539
|
- lib/dapp/dimg/cli/command/dimg/list.rb
|
538
540
|
- lib/dapp/dimg/cli/command/dimg/mrproper.rb
|
539
541
|
- lib/dapp/dimg/cli/command/dimg/push.rb
|
@@ -575,7 +577,9 @@ files:
|
|
575
577
|
- lib/dapp/dimg/dapp/command/build_context/export.rb
|
576
578
|
- lib/dapp/dimg/dapp/command/build_context/import.rb
|
577
579
|
- lib/dapp/dimg/dapp/command/cleanup.rb
|
580
|
+
- lib/dapp/dimg/dapp/command/cleanup_repo.rb
|
578
581
|
- lib/dapp/dimg/dapp/command/common.rb
|
582
|
+
- lib/dapp/dimg/dapp/command/flush_repo.rb
|
579
583
|
- lib/dapp/dimg/dapp/command/list.rb
|
580
584
|
- lib/dapp/dimg/dapp/command/mrproper.rb
|
581
585
|
- lib/dapp/dimg/dapp/command/push.rb
|