avm-git 0.7.0 → 0.9.0

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: b1b4c7e2df892e08fd3acc46995c6c353476d2f278dbea6d7f4f6610f59c147d
4
- data.tar.gz: abfc3a667d26edfd434b471314772e14df09a54fb3c5921cad56c51f2361d400
3
+ metadata.gz: fd42a24152f0e8d274a949a9deb85c7e488ca50ee8d2343d416726a5b56d1c76
4
+ data.tar.gz: 219a048ed9d9468c803e510211f7518433a61a7ffab4e238ad320e4854af780e
5
5
  SHA512:
6
- metadata.gz: df7fdde7ab8665aec13a8c1d89279de503a75dc034122c0cfd4b907056741631d834876745431c006ef474107e99075aaf3a3080e700a8d0526d5f4b3afaf110
7
- data.tar.gz: a575f67380e389681bbbe28e7d1f738b43eda8d8b2a8578117ba52f2d14d215afe510e6edb4c3fd57f302c0ae5b247eff4cdb188518b8b4eea1c95d67cee6255
6
+ metadata.gz: 10d0657d1221fd5686a6b912f0453d2220314c761e4bade985dcc7426db84c91aea6a23d678414e183fe10d7ea72b92376857d1132d93e2bf8033648f52561b3
7
+ data.tar.gz: bef8e125f600ec5da2b01d2e1e87a9b4ceaf9f13325fcba7f6a93217d41f45a5355b475bcc459012a0265768f942ea092f289ebf698d9e0394cc0e5a0e453025
@@ -19,16 +19,14 @@ module Avm
19
19
  r
20
20
  end
21
21
 
22
- def execute(*args)
23
- command(*args).execute
24
- end
25
-
26
- def execute!(*args)
27
- command(*args).execute!
28
- end
29
-
30
- def system!(*args)
31
- command(*args).system!
22
+ %w[execute execute! system system!].each do |exec_type|
23
+ define_method exec_type do |*args|
24
+ begin
25
+ command(*args).send(exec_type)
26
+ rescue ::EacRubyUtils::Envs::Command::ExecError
27
+ raise ::Avm::Git::Launcher::Error
28
+ end
29
+ end
32
30
  end
33
31
 
34
32
  def init
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/files/appendable'
4
+ require 'avm/files/deploy'
5
+ require 'avm/scms/base'
6
+ require 'avm/scms/commit'
7
+ require 'eac_ruby_utils/core_ext'
8
+
9
+ module Avm
10
+ module Git
11
+ module Scms
12
+ class Git < ::Avm::Scms::Base
13
+ class Commit < ::Avm::Scms::Commit
14
+ class Deploy
15
+ include ::Avm::Files::Appendable
16
+ enable_simple_cache
17
+
18
+ attr_reader :build_dir, :commit, :target_env, :target_path
19
+
20
+ def initialize(commit, target_env, target_path)
21
+ @commit = commit
22
+ @target_env = target_env
23
+ @target_path = target_path
24
+ end
25
+
26
+ def run
27
+ fd = ::Avm::Files::Deploy.new(target_env, target_path)
28
+ fd.append_tar_output_command(git_archive_command)
29
+ fd.appended.push(*appended)
30
+ fd.run
31
+ end
32
+
33
+ private
34
+
35
+ def git_archive_command
36
+ commit.git_repo.command('archive', '--format=tar', commit.id)
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/git/commit'
4
+ require 'avm/git/scms/git/commit/deploy'
5
+ require 'avm/scms/base'
6
+ require 'avm/scms/commit'
7
+ require 'eac_ruby_utils/core_ext'
8
+
9
+ module Avm
10
+ module Git
11
+ module Scms
12
+ class Git < ::Avm::Scms::Base
13
+ class Commit < ::Avm::Scms::Commit
14
+ module DeployMethods
15
+ def deploy_to_env_path(target_env, target_path)
16
+ ::Avm::Git::Scms::Git::Commit::Deploy.new(self, target_env, target_path)
17
+ end
18
+
19
+ def deploy_to_url(target_url)
20
+ ::Avm::Git::Scms::Git::Commit::Deploy.new(
21
+ self,
22
+ *::Avm::Git::Commit.target_url_to_env_path(target_url)
23
+ )
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -8,10 +8,12 @@ module Avm
8
8
  module Scms
9
9
  class Git < ::Avm::Scms::Base
10
10
  class Commit < ::Avm::Scms::Commit
11
+ require_sub __FILE__, include_modules: true
11
12
  common_constructor :git_scm, :git_commit do
12
13
  git_commit.assert_argument(::EacGit::Local::Commit, 'git_commit')
13
14
  end
14
15
  delegate :git_repo, to: :git_scm
16
+ delegate :id, to: :git_commit
15
17
 
16
18
  # @return [Array<Pathname>]
17
19
  def changed_files
@@ -18,7 +18,7 @@ module Avm
18
18
  end
19
19
 
20
20
  # @return [Avm::Git::Scms::Git::Commit,nil]
21
- def commitize(source)
21
+ def commit(source)
22
22
  if source.is_a?(::Avm::Git::Scms::Git::Commit)
23
23
  return source if source.git_repo == self
24
24
 
@@ -36,7 +36,7 @@ module Avm
36
36
  git_repo.command('add', '.').execute!
37
37
  git_repo.command('commit', '-m',
38
38
  message.call_if_proc.if_present(COMMIT_DIRTY_DEFAULT_MESSAGE)).execute!
39
- commitize(git_repo.head)
39
+ commit(git_repo.head)
40
40
  end
41
41
 
42
42
  # @return [Avm::Git::Scms::Git::Commit,nil]
@@ -53,7 +53,7 @@ module Avm
53
53
 
54
54
  # @return [Avm::Git::Scms::Git::Commit]
55
55
  def reset_and_commit(commit_to_reset, message)
56
- git_repo.command('reset', '--soft', commitize(commit_to_reset).git_commit.id).execute!
56
+ git_repo.command('reset', '--soft', commit(commit_to_reset).git_commit.id).execute!
57
57
  commit_dirty(message)
58
58
  end
59
59
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Git
5
- VERSION = '0.7.0'
5
+ VERSION = '0.9.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-13 00:00:00.000000000 Z
11
+ date: 2022-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -16,68 +16,62 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.49'
19
+ version: '0.53'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.49'
26
+ version: '0.53'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: avm-files
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.4'
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 0.4.1
33
+ version: '0.6'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
- version: '0.4'
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 0.4.1
40
+ version: '0.6'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: eac_git
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0.12'
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: 0.12.3
47
+ version: '0.13'
57
48
  type: :runtime
58
49
  prerelease: false
59
50
  version_requirements: !ruby/object:Gem::Requirement
60
51
  requirements:
61
52
  - - "~>"
62
53
  - !ruby/object:Gem::Version
63
- version: '0.12'
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: 0.12.3
54
+ version: '0.13'
67
55
  - !ruby/object:Gem::Dependency
68
56
  name: eac_ruby_utils
69
57
  requirement: !ruby/object:Gem::Requirement
70
58
  requirements:
71
59
  - - "~>"
72
60
  - !ruby/object:Gem::Version
73
- version: '0.104'
61
+ version: '0.106'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 0.106.1
74
65
  type: :runtime
75
66
  prerelease: false
76
67
  version_requirements: !ruby/object:Gem::Requirement
77
68
  requirements:
78
69
  - - "~>"
79
70
  - !ruby/object:Gem::Version
80
- version: '0.104'
71
+ version: '0.106'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 0.106.1
81
75
  - !ruby/object:Gem::Dependency
82
76
  name: git
83
77
  requirement: !ruby/object:Gem::Requirement
@@ -145,8 +139,6 @@ files:
145
139
  - lib/avm/git/auto_commit_path/ruby.rb
146
140
  - lib/avm/git/commit.rb
147
141
  - lib/avm/git/commit/class_methods.rb
148
- - lib/avm/git/commit/deploy.rb
149
- - lib/avm/git/commit/deploy_methods.rb
150
142
  - lib/avm/git/commit/diff_tree_line.rb
151
143
  - lib/avm/git/commit/file.rb
152
144
  - lib/avm/git/file_auto_fixup.rb
@@ -197,6 +189,8 @@ files:
197
189
  - lib/avm/git/scms/git.rb
198
190
  - lib/avm/git/scms/git/change_tracker.rb
199
191
  - lib/avm/git/scms/git/commit.rb
192
+ - lib/avm/git/scms/git/commit/deploy.rb
193
+ - lib/avm/git/scms/git/commit/deploy_methods.rb
200
194
  - lib/avm/git/scms/git_subrepo.rb
201
195
  - lib/avm/git/scms/provider.rb
202
196
  - lib/avm/git/subrepo_check.rb
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'addressable'
4
- require 'eac_ruby_utils/core_ext'
5
- require 'avm/files/appendable'
6
- require 'avm/files/deploy'
7
-
8
- module Avm
9
- module Git
10
- class Commit
11
- class Deploy
12
- include ::Avm::Files::Appendable
13
- enable_simple_cache
14
-
15
- attr_reader :build_dir, :commit, :target_env, :target_path
16
-
17
- def initialize(commit, target_env, target_path)
18
- @commit = commit
19
- @target_env = target_env
20
- @target_path = target_path
21
- end
22
-
23
- def run
24
- fd = ::Avm::Files::Deploy.new(target_env, target_path)
25
- fd.append_tar_output_command(git_archive_command)
26
- fd.appended.push(*appended)
27
- fd.run
28
- end
29
-
30
- private
31
-
32
- def git_archive_command
33
- commit.git.command('archive', '--format=tar', commit.sha1)
34
- end
35
- end
36
- end
37
- end
38
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
-
5
- module Avm
6
- module Git
7
- class Commit
8
- module DeployMethods
9
- def deploy_to_env_path(target_env, target_path)
10
- Deploy.new(self, target_env, target_path)
11
- end
12
-
13
- def deploy_to_url(target_url)
14
- Deploy.new(self, *self.class.target_url_to_env_path(target_url))
15
- end
16
- end
17
- end
18
- end
19
- end