avm-git 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/git/scms/git/commit/deploy.rb +43 -0
- data/lib/avm/git/scms/git/commit/deploy_methods.rb +30 -0
- data/lib/avm/git/scms/git/commit.rb +2 -0
- data/lib/avm/git/scms/git.rb +3 -3
- data/lib/avm/git/version.rb +1 -1
- metadata +16 -16
- data/lib/avm/git/commit/deploy.rb +0 -38
- data/lib/avm/git/commit/deploy_methods.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd42a24152f0e8d274a949a9deb85c7e488ca50ee8d2343d416726a5b56d1c76
|
4
|
+
data.tar.gz: 219a048ed9d9468c803e510211f7518433a61a7ffab4e238ad320e4854af780e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10d0657d1221fd5686a6b912f0453d2220314c761e4bade985dcc7426db84c91aea6a23d678414e183fe10d7ea72b92376857d1132d93e2bf8033648f52561b3
|
7
|
+
data.tar.gz: bef8e125f600ec5da2b01d2e1e87a9b4ceaf9f13325fcba7f6a93217d41f45a5355b475bcc459012a0265768f942ea092f289ebf698d9e0394cc0e5a0e453025
|
@@ -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
|
data/lib/avm/git/scms/git.rb
CHANGED
@@ -18,7 +18,7 @@ module Avm
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# @return [Avm::Git::Scms::Git::Commit,nil]
|
21
|
-
def
|
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
|
-
|
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',
|
56
|
+
git_repo.command('reset', '--soft', commit(commit_to_reset).git_commit.id).execute!
|
57
57
|
commit_dirty(message)
|
58
58
|
end
|
59
59
|
|
data/lib/avm/git/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avm
|
@@ -16,34 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
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.
|
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.
|
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.
|
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
|
@@ -64,14 +58,20 @@ dependencies:
|
|
64
58
|
requirements:
|
65
59
|
- - "~>"
|
66
60
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0.
|
61
|
+
version: '0.106'
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 0.106.1
|
68
65
|
type: :runtime
|
69
66
|
prerelease: false
|
70
67
|
version_requirements: !ruby/object:Gem::Requirement
|
71
68
|
requirements:
|
72
69
|
- - "~>"
|
73
70
|
- !ruby/object:Gem::Version
|
74
|
-
version: '0.
|
71
|
+
version: '0.106'
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 0.106.1
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: git
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,8 +139,6 @@ files:
|
|
139
139
|
- lib/avm/git/auto_commit_path/ruby.rb
|
140
140
|
- lib/avm/git/commit.rb
|
141
141
|
- lib/avm/git/commit/class_methods.rb
|
142
|
-
- lib/avm/git/commit/deploy.rb
|
143
|
-
- lib/avm/git/commit/deploy_methods.rb
|
144
142
|
- lib/avm/git/commit/diff_tree_line.rb
|
145
143
|
- lib/avm/git/commit/file.rb
|
146
144
|
- lib/avm/git/file_auto_fixup.rb
|
@@ -191,6 +189,8 @@ files:
|
|
191
189
|
- lib/avm/git/scms/git.rb
|
192
190
|
- lib/avm/git/scms/git/change_tracker.rb
|
193
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
|
194
194
|
- lib/avm/git/scms/git_subrepo.rb
|
195
195
|
- lib/avm/git/scms/provider.rb
|
196
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
|