dapp 0.6.17 → 0.7.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.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/config/en/common.yml +2 -2
  3. data/config/en/net_status.yml +25 -23
  4. data/lib/dapp.rb +24 -16
  5. data/lib/dapp/artifact.rb +1 -1
  6. data/lib/dapp/build/stage/after_install_artifact.rb +2 -2
  7. data/lib/dapp/build/stage/after_setup_artifact.rb +4 -4
  8. data/lib/dapp/build/stage/artifact_base.rb +25 -25
  9. data/lib/dapp/build/stage/artifact_default.rb +16 -16
  10. data/lib/dapp/build/stage/base.rb +36 -31
  11. data/lib/dapp/build/stage/before_install.rb +8 -8
  12. data/lib/dapp/build/stage/before_install_artifact.rb +2 -2
  13. data/lib/dapp/build/stage/before_setup.rb +8 -8
  14. data/lib/dapp/build/stage/before_setup_artifact.rb +2 -2
  15. data/lib/dapp/build/stage/build_artifact.rb +10 -10
  16. data/lib/dapp/build/stage/docker_instructions.rb +3 -3
  17. data/lib/dapp/build/stage/from.rb +7 -3
  18. data/lib/dapp/build/stage/ga_archive.rb +2 -2
  19. data/lib/dapp/build/stage/ga_archive_dependencies.rb +3 -3
  20. data/lib/dapp/build/stage/ga_artifact_patch.rb +2 -2
  21. data/lib/dapp/build/stage/ga_base.rb +2 -2
  22. data/lib/dapp/build/stage/ga_dependencies_base.rb +2 -2
  23. data/lib/dapp/build/stage/ga_latest_patch.rb +3 -3
  24. data/lib/dapp/build/stage/import_artifact.rb +19 -19
  25. data/lib/dapp/build/stage/install/ga_post_install_patch.rb +2 -2
  26. data/lib/dapp/build/stage/install/ga_post_install_patch_dependencies.rb +2 -2
  27. data/lib/dapp/build/stage/install/ga_pre_install_patch.rb +2 -2
  28. data/lib/dapp/build/stage/install/ga_pre_install_patch_dependencies.rb +2 -2
  29. data/lib/dapp/build/stage/install/install.rb +9 -9
  30. data/lib/dapp/build/stage/mod/group.rb +2 -2
  31. data/lib/dapp/build/stage/mod/logging.rb +19 -19
  32. data/lib/dapp/build/stage/setup/chef_cookbooks.rb +4 -4
  33. data/lib/dapp/build/stage/setup/ga_post_setup_patch.rb +2 -2
  34. data/lib/dapp/build/stage/setup/ga_post_setup_patch_dependencies.rb +3 -3
  35. data/lib/dapp/build/stage/setup/ga_pre_setup_patch.rb +2 -2
  36. data/lib/dapp/build/stage/setup/ga_pre_setup_patch_dependencies.rb +2 -2
  37. data/lib/dapp/build/stage/setup/setup.rb +9 -9
  38. data/lib/dapp/builder/base.rb +4 -4
  39. data/lib/dapp/builder/chef.rb +65 -64
  40. data/lib/dapp/builder/none.rb +45 -0
  41. data/lib/dapp/builder/shell.rb +3 -3
  42. data/lib/dapp/cli.rb +9 -10
  43. data/lib/dapp/cli/base.rb +6 -1
  44. data/lib/dapp/cli/bp.rb +2 -2
  45. data/lib/dapp/cli/build.rb +2 -2
  46. data/lib/dapp/cli/cleanup.rb +2 -2
  47. data/lib/dapp/cli/list.rb +2 -2
  48. data/lib/dapp/cli/mrproper.rb +0 -4
  49. data/lib/dapp/cli/push.rb +3 -3
  50. data/lib/dapp/cli/run.rb +3 -3
  51. data/lib/dapp/cli/spush.rb +2 -2
  52. data/lib/dapp/cli/stage_image.rb +2 -2
  53. data/lib/dapp/cli/stages/cleanup_local.rb +3 -3
  54. data/lib/dapp/cli/stages/cleanup_repo.rb +3 -3
  55. data/lib/dapp/cli/stages/flush_local.rb +3 -3
  56. data/lib/dapp/cli/stages/flush_repo.rb +3 -3
  57. data/lib/dapp/cli/stages/pull.rb +3 -3
  58. data/lib/dapp/cli/stages/push.rb +3 -3
  59. data/lib/dapp/config/artifact_dimg.rb +18 -0
  60. data/lib/dapp/config/artifact_group.rb +54 -0
  61. data/lib/dapp/config/base.rb +19 -0
  62. data/lib/dapp/config/dimg.rb +23 -0
  63. data/lib/dapp/config/dimg/instance_methods.rb +179 -0
  64. data/lib/dapp/config/dimg/validation.rb +124 -0
  65. data/lib/dapp/config/dimg_group.rb +56 -0
  66. data/lib/dapp/config/dimg_group_base.rb +36 -0
  67. data/lib/dapp/config/dimg_group_main.rb +21 -0
  68. data/lib/dapp/config/directive/artifact.rb +29 -54
  69. data/lib/dapp/config/directive/artifact_base.rb +92 -0
  70. data/lib/dapp/config/directive/base.rb +22 -0
  71. data/lib/dapp/config/directive/chef.rb +23 -61
  72. data/lib/dapp/config/directive/docker/artifact.rb +3 -14
  73. data/lib/dapp/config/directive/docker/base.rb +3 -78
  74. data/lib/dapp/config/directive/docker/dimg.rb +81 -0
  75. data/lib/dapp/config/directive/git_artifact_local.rb +13 -0
  76. data/lib/dapp/config/directive/git_artifact_remote.rb +55 -0
  77. data/lib/dapp/config/directive/mount.rb +25 -0
  78. data/lib/dapp/config/directive/shell/artifact.rb +3 -24
  79. data/lib/dapp/config/directive/shell/dimg.rb +68 -0
  80. data/lib/dapp/{application.rb → dimg.rb} +12 -33
  81. data/lib/dapp/{application → dimg}/git_artifact.rb +3 -3
  82. data/lib/dapp/{application → dimg}/path.rb +9 -5
  83. data/lib/dapp/{application → dimg}/stages.rb +8 -8
  84. data/lib/dapp/{application → dimg}/tags.rb +6 -6
  85. data/lib/dapp/docker_registry.rb +11 -15
  86. data/lib/dapp/error/dimg.rb +6 -0
  87. data/lib/dapp/git_artifact.rb +19 -20
  88. data/lib/dapp/git_repo/base.rb +6 -6
  89. data/lib/dapp/git_repo/own.rb +4 -4
  90. data/lib/dapp/git_repo/remote.rb +5 -5
  91. data/lib/dapp/image/docker.rb +0 -15
  92. data/lib/dapp/image/stage.rb +12 -22
  93. data/lib/dapp/project.rb +14 -18
  94. data/lib/dapp/project/command/build.rb +2 -2
  95. data/lib/dapp/project/command/cleanup.rb +9 -11
  96. data/lib/dapp/project/command/common.rb +8 -20
  97. data/lib/dapp/project/command/list.rb +7 -1
  98. data/lib/dapp/project/command/mrproper.rb +12 -22
  99. data/lib/dapp/project/command/push.rb +3 -4
  100. data/lib/dapp/project/command/run.rb +2 -2
  101. data/lib/dapp/project/command/spush.rb +3 -4
  102. data/lib/dapp/project/command/stage_image.rb +2 -2
  103. data/lib/dapp/project/command/stages/cleanup_local.rb +20 -24
  104. data/lib/dapp/project/command/stages/cleanup_repo.rb +3 -3
  105. data/lib/dapp/project/command/stages/common.rb +2 -3
  106. data/lib/dapp/project/command/stages/flush_local.rb +5 -7
  107. data/lib/dapp/project/command/stages/flush_repo.rb +2 -2
  108. data/lib/dapp/project/command/stages/pull.rb +3 -4
  109. data/lib/dapp/project/command/stages/push.rb +3 -4
  110. data/lib/dapp/project/dappfile.rb +9 -26
  111. data/lib/dapp/project/logging/base.rb +14 -0
  112. data/lib/dapp/project/logging/process.rb +1 -1
  113. data/lib/dapp/project/shellout/system.rb +2 -4
  114. data/lib/dapp/version.rb +1 -1
  115. metadata +25 -17
  116. data/lib/dapp/cli/tag.rb +0 -24
  117. data/lib/dapp/config/application.rb +0 -288
  118. data/lib/dapp/config/artifact.rb +0 -20
  119. data/lib/dapp/config/directive/build_dir.rb +0 -9
  120. data/lib/dapp/config/directive/git_artifact.rb +0 -59
  121. data/lib/dapp/config/directive/shell/base.rb +0 -85
  122. data/lib/dapp/config/directive/tmp_dir.rb +0 -36
  123. data/lib/dapp/config/main.rb +0 -20
  124. data/lib/dapp/error/application.rb +0 -6
  125. data/lib/dapp/project/command/tag.rb +0 -18
@@ -1,9 +0,0 @@
1
- module Dapp
2
- module Config
3
- module Directive
4
- # BuildDir
5
- class BuildDir < TmpDir
6
- end
7
- end
8
- end
9
- end
@@ -1,59 +0,0 @@
1
- module Dapp
2
- module Config
3
- module Directive
4
- # GitArtifact
5
- class GitArtifact
6
- attr_reader :_local
7
- attr_reader :_remote
8
-
9
- def initialize
10
- @_local = []
11
- @_remote = []
12
- end
13
-
14
- def local(*args)
15
- @_local.tap { |local| local << Local.new(*args) unless args.empty? }
16
- end
17
-
18
- def remote(*args)
19
- @_remote.tap { |remote| remote << Remote.new(*args) unless args.empty? }
20
- end
21
-
22
- protected
23
-
24
- def clone
25
- Marshal.load(Marshal.dump(self))
26
- end
27
-
28
- def empty?
29
- _local.empty? && _remote.empty?
30
- end
31
-
32
- # Local
33
- class Local < Artifact::Base
34
- protected
35
-
36
- def code
37
- :git_artifact_unexpected_attribute
38
- end
39
- end
40
-
41
- # Remote
42
- class Remote < Local
43
- attr_accessor :_url, :_name, :_branch
44
-
45
- def initialize(url, where_to_add, **options)
46
- @_url = url
47
- @_name = url.gsub(%r{.*?([^\/ ]+)\.git}, '\\1')
48
- @_branch = options.delete(:branch)
49
- super(where_to_add, **options)
50
- end
51
-
52
- def _artifact_options
53
- super.merge(name: _name, branch: _branch)
54
- end
55
- end
56
- end
57
- end
58
- end
59
- end
@@ -1,85 +0,0 @@
1
- module Dapp
2
- module Config
3
- module Directive
4
- module Shell
5
- # Base
6
- class Base
7
- attr_reader :_before_install, :_before_setup, :_install, :_setup
8
- attr_reader :_before_install_cache_version, :_before_setup_cache_version, :_install_cache_version, :_setup_cache_version
9
-
10
- def initialize
11
- @_before_install = []
12
- @_before_setup = []
13
- @_install = []
14
- @_setup = []
15
- end
16
-
17
- def before_install(*args, cache_version: nil)
18
- @_before_install.concat(args)
19
- @_before_install_cache_version = cache_version
20
- end
21
-
22
- def before_setup(*args, cache_version: nil)
23
- @_before_setup.concat(args)
24
- @_before_setup_cache_version = cache_version
25
- end
26
-
27
- def install(*args, cache_version: nil)
28
- @_install.concat(args)
29
- @_install_cache_version = cache_version
30
- end
31
-
32
- def setup(*args, cache_version: nil)
33
- @_setup.concat(args)
34
- @_setup_cache_version = cache_version
35
- end
36
-
37
- def reset_before_install
38
- @_before_install = []
39
- end
40
-
41
- def reset_before_setup
42
- @_before_setup = []
43
- end
44
-
45
- def reset_install
46
- @_install = []
47
- end
48
-
49
- def reset_setup
50
- @_setup = []
51
- end
52
-
53
- def reset_all
54
- methods.tap { |arr| arr.delete(__method__) }.grep(/^reset_/).each(&method(:send))
55
- end
56
-
57
- protected
58
-
59
- def clone
60
- marshal_dup(self)
61
- end
62
-
63
- def clone_to_artifact
64
- Artifact.new.tap do |shell|
65
- instance_variables.each do |variable|
66
- shell.instance_variable_set(variable, marshal_dup(instance_variable_get(variable)))
67
- shell.instance_variable_set("#{variable}_cache_version", marshal_dup(instance_variable_get("#{variable}_cache_version")))
68
- end
69
- end
70
- end
71
-
72
- def empty?
73
- @_before_install.empty? && @_before_setup.empty? && @_install.empty? && @_setup.empty?
74
- end
75
-
76
- private
77
-
78
- def marshal_dup(obj)
79
- Marshal.load(Marshal.dump(obj))
80
- end
81
- end
82
- end
83
- end
84
- end
85
- end
@@ -1,36 +0,0 @@
1
- module Dapp
2
- module Config
3
- module Directive
4
- # TmpDir
5
- class TmpDir
6
- attr_reader :_store
7
-
8
- def initialize
9
- @_store = []
10
- end
11
-
12
- def store(*args)
13
- _store.concat(args)
14
- end
15
-
16
- def unstore(*args)
17
- @_store -= args
18
- end
19
-
20
- def reset
21
- @_store = []
22
- end
23
-
24
- protected
25
-
26
- def empty?
27
- _store.empty?
28
- end
29
-
30
- def clone
31
- Marshal.load(Marshal.dump(self))
32
- end
33
- end
34
- end
35
- end
36
- end
@@ -1,20 +0,0 @@
1
- module Dapp
2
- module Config
3
- # Application
4
- class Main < Application
5
- def initialize(dappfile_path:, project:)
6
- @project = project
7
-
8
- @_home_path = Pathname.new(dappfile_path).parent.expand_path.to_s
9
- @_basename = Pathname.new(@_home_path).basename.to_s
10
- @_builder = Pathname.new(@_home_path).join('Berksfile').exist? ? :chef : :shell
11
- super(nil)
12
- end
13
-
14
- def name(value)
15
- project.log_warning(desc: { code: 'excess_name_instruction' }) if @_basename == value.to_s
16
- @_basename = value
17
- end
18
- end
19
- end
20
- end
@@ -1,6 +0,0 @@
1
- module Dapp
2
- module Error
3
- # Application
4
- class Application < Base; end
5
- end
6
- end
@@ -1,18 +0,0 @@
1
- module Dapp
2
- # Project
3
- class Project
4
- # Command
5
- module Command
6
- # Tag
7
- module Tag
8
- def tag(tag)
9
- raise Error::Project, code: :tag_command_unexpected_apps_number unless build_configs.one?
10
- raise Error::Project, code: :tag_command_incorrect_tag, data: { name: tag } unless Image::Docker.image_name?(tag)
11
- Application.new(config: build_configs.first, project: self, ignore_git_fetch: true, should_be_built: true).tap do |app|
12
- app.tag!(tag)
13
- end
14
- end
15
- end
16
- end
17
- end # Project
18
- end # Dapp