avmtrf1-tools 0.31.2 → 0.33.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avmtrf1/active_directory/user.rb +3 -3
- data/lib/avmtrf1/core_ext.rb +4 -0
- data/lib/avmtrf1/default_jira.rb +2 -2
- data/lib/avmtrf1/executables.rb +10 -2
- data/lib/avmtrf1/git/cached_repository.rb +2 -2
- data/lib/avmtrf1/git/issue_on_repository.rb +2 -2
- data/lib/avmtrf1/git/push_large.rb +4 -4
- data/lib/avmtrf1/git/push_large/lfs_commit.rb +5 -10
- data/lib/avmtrf1/git/push_large/lfs_commit/cache.rb +19 -0
- data/lib/avmtrf1/git/push_large/lfs_commit/checkout_previous_revision.rb +35 -0
- data/lib/avmtrf1/git/push_large/lfs_commit/commit_changes.rb +48 -0
- data/lib/avmtrf1/git/push_large/lfs_commit/helpers.rb +29 -0
- data/lib/avmtrf1/git/push_large/lfs_commit/pick_source_revision.rb +103 -0
- data/lib/avmtrf1/git/push_large/lfs_commit/push.rb +90 -0
- data/lib/avmtrf1/git/push_large/lfs_commit/track_large_files.rb +53 -0
- data/lib/avmtrf1/git/push_large/source_commit.rb +4 -7
- data/lib/avmtrf1/git/push_large/source_commit/push.rb +42 -0
- data/lib/avmtrf1/inventario_sistemas/site_build/html_page_base.rb +1 -1
- data/lib/avmtrf1/openvpn/config/builder.rb +59 -0
- data/lib/avmtrf1/openvpn/config/parser.rb +20 -0
- data/lib/avmtrf1/openvpn/config/parser/builder.rb +62 -0
- data/lib/avmtrf1/openvpn/config/parser/line.rb +47 -0
- data/lib/avmtrf1/openvpn/config/parser/simple.rb +27 -0
- data/lib/avmtrf1/openvpn/config/parser/tag.rb +39 -0
- data/lib/avmtrf1/patches.rb +3 -0
- data/lib/avmtrf1/patches/avm.rb +4 -0
- data/lib/avmtrf1/patches/avm/git.rb +4 -0
- data/lib/avmtrf1/patches/avm/git/issue.rb +4 -0
- data/lib/avmtrf1/patches/avm/launcher.rb +4 -0
- data/lib/avmtrf1/patches/avm/launcher/git.rb +4 -0
- data/lib/avmtrf1/patches/avm/launcher/git/base.rb +46 -0
- data/lib/avmtrf1/red/helper.rb +2 -2
- data/lib/avmtrf1/template.rb +2 -2
- data/lib/avmtrf1/tools/application.rb +13 -0
- data/lib/avmtrf1/tools/runner.rb +18 -25
- data/lib/avmtrf1/tools/runner/check_point.rb +8 -14
- data/lib/avmtrf1/tools/runner/check_point/login.rb +7 -20
- data/lib/avmtrf1/tools/runner/esosti.rb +9 -21
- data/lib/avmtrf1/tools/runner/esosti/changed.rb +10 -23
- data/lib/avmtrf1/tools/runner/esosti/fetch.rb +10 -23
- data/lib/avmtrf1/tools/runner/esosti/request.rb +18 -30
- data/lib/avmtrf1/tools/runner/forponto.rb +14 -24
- data/lib/avmtrf1/tools/runner/forponto/espelho.rb +12 -22
- data/lib/avmtrf1/tools/runner/forponto/marcacoes.rb +8 -19
- data/lib/avmtrf1/tools/runner/forponto/resumos.rb +8 -20
- data/lib/avmtrf1/tools/runner/forponto/saldo.rb +11 -22
- data/lib/avmtrf1/tools/runner/git.rb +3 -5
- data/lib/avmtrf1/tools/runner/git/issues_check.rb +8 -19
- data/lib/avmtrf1/tools/runner/git/push_large.rb +28 -19
- data/lib/avmtrf1/tools/runner/inventario_sistemas.rb +7 -9
- data/lib/avmtrf1/tools/runner/openvpn.rb +91 -0
- data/lib/avmtrf1/tools/runner/oracle.rb +16 -23
- data/lib/avmtrf1/tools/runner/oracle/query.rb +10 -14
- data/lib/avmtrf1/tools/runner/oracle/source_get.rb +18 -19
- data/lib/avmtrf1/tools/runner/oracle/user_clear.rb +8 -16
- data/lib/avmtrf1/tools/runner/php.rb +8 -15
- data/lib/avmtrf1/tools/runner/php/docker.rb +21 -31
- data/lib/avmtrf1/tools/runner/red.rb +22 -26
- data/lib/avmtrf1/tools/runner/trf1_dspace_base0.rb +10 -19
- data/lib/avmtrf1/tools/runner/trf1_dspace_base0/deploy.rb +2 -2
- data/lib/avmtrf1/tools/version.rb +1 -1
- data/template/avmtrf1/php/docker_image/Dockerfile.template +4 -1
- metadata +30 -93
- data/lib/avmtrf1/configs.rb +0 -24
- data/lib/avmtrf1/git/push_large/lfs_commit/_00_checkout_previous_revision.rb +0 -33
- data/lib/avmtrf1/git/push_large/lfs_commit/_01_cherry_pick_source_revision.rb +0 -89
- data/lib/avmtrf1/git/push_large/lfs_commit/_02_track_large_files.rb +0 -51
- data/lib/avmtrf1/git/push_large/lfs_commit/_03_commit_changes.rb +0 -46
- data/lib/avmtrf1/git/push_large/lfs_commit/_04_push.rb +0 -88
- data/lib/avmtrf1/git/push_large/lfs_commit/_cache.rb +0 -17
- data/lib/avmtrf1/git/push_large/lfs_commit/_helpers.rb +0 -27
- data/lib/avmtrf1/git/push_large/source_commit/_push.rb +0 -40
- data/lib/avmtrf1/patches/eac_launcher/git/base.rb +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 712c7f89fa087baaf3a67fd09ee39715bef7145b75e99f19619091e397420192
|
4
|
+
data.tar.gz: e3257f03a2fdd1a006e80ab3a2f717e8db267dc925efea0686901996cf92f4ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a722aee3d0e3d807b1805bd4eb392c9ab3a21f010788ada1d2e7a8e821ef455bca195aa432da4f3a6a93df9041fb4787149316cb4bbebf535f6f74815d9de29
|
7
|
+
data.tar.gz: 2c4ead14802c1ba4b03e8e2f6964fef2f13e12f5e4e55a5e7571a3a2bc1385249d1d3fbdbd3f7ca2bc2d3f0ac10fe38b6006403e69f110f629a69aba0f758ef4
|
@@ -6,9 +6,9 @@ module Avmtrf1
|
|
6
6
|
class << self
|
7
7
|
def by_configs(path_prefix)
|
8
8
|
new(
|
9
|
-
::
|
10
|
-
::
|
11
|
-
::
|
9
|
+
::Avm::Apps::Config.current.read_entry("#{path_prefix}.domain"),
|
10
|
+
::Avm::Apps::Config.current.read_entry("#{path_prefix}.username"),
|
11
|
+
::Avm::Apps::Config.current.read_password("#{path_prefix}.password")
|
12
12
|
)
|
13
13
|
end
|
14
14
|
end
|
data/lib/avmtrf1/default_jira.rb
CHANGED
@@ -9,8 +9,8 @@ module Avmtrf1
|
|
9
9
|
def default_jira
|
10
10
|
@default_jira ||= ::Avmtrf1::Jira::Instance.new(
|
11
11
|
'https://jira.engesoftware.com.br',
|
12
|
-
::
|
13
|
-
::
|
12
|
+
::Avm::Apps::Config.current.read_entry("#{DEFAULT_JIRA_PATH_PREFIX}.username"),
|
13
|
+
::Avm::Apps::Config.current.read_password("#{DEFAULT_JIRA_PATH_PREFIX}.password")
|
14
14
|
)
|
15
15
|
end
|
16
16
|
end
|
data/lib/avmtrf1/executables.rb
CHANGED
@@ -1,14 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
3
5
|
module Avmtrf1
|
4
6
|
module Executables
|
5
7
|
class << self
|
8
|
+
enable_simple_cache
|
9
|
+
|
6
10
|
def env
|
7
11
|
::EacRubyUtils::Envs.local
|
8
12
|
end
|
9
13
|
|
10
|
-
|
11
|
-
|
14
|
+
private
|
15
|
+
|
16
|
+
%w[docker sudo].each do |program|
|
17
|
+
define_method(program.underscore + '_uncached') do
|
18
|
+
env.executable(program, '--version')
|
19
|
+
end
|
12
20
|
end
|
13
21
|
end
|
14
22
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'avm/launcher/git/base'
|
4
4
|
|
5
5
|
module Avmtrf1
|
6
6
|
module Git
|
7
|
-
class CachedRepository < ::
|
7
|
+
class CachedRepository < ::Avm::Launcher::Git::Base
|
8
8
|
attr_reader :url
|
9
9
|
|
10
10
|
def initialize(url)
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'eac_ruby_utils/
|
3
|
+
require 'eac_ruby_utils/patches/module/speaker'
|
4
4
|
require 'eac_ruby_utils/simple_cache'
|
5
5
|
require 'avmtrf1/result'
|
6
6
|
|
7
7
|
module Avmtrf1
|
8
8
|
module Git
|
9
9
|
class IssueOnRepository
|
10
|
-
|
10
|
+
enable_speaker
|
11
11
|
include ::EacRubyUtils::SimpleCache
|
12
12
|
|
13
13
|
CHECKS = %w[no_branch_nor_tag branch_and_tag issue_not_found issue_closed_git_open
|
@@ -2,23 +2,23 @@
|
|
2
2
|
|
3
3
|
require 'ostruct'
|
4
4
|
|
5
|
-
require 'eac_ruby_utils/
|
5
|
+
require 'eac_ruby_utils/patches/module/speaker'
|
6
6
|
require 'eac_ruby_utils/require_sub'
|
7
7
|
require 'eac_ruby_utils/simple_cache'
|
8
|
-
require 'avmtrf1/patches/
|
8
|
+
require 'avmtrf1/patches/avm/launcher/git/base'
|
9
9
|
|
10
10
|
module Avmtrf1
|
11
11
|
module Git
|
12
12
|
class PushLarge
|
13
13
|
include ::EacRubyUtils::SimpleCache
|
14
|
-
|
14
|
+
enable_speaker
|
15
15
|
|
16
16
|
::EacRubyUtils.require_sub(__FILE__)
|
17
17
|
|
18
18
|
attr_reader :git, :remote_name, :source_ref, :target_ref, :last_pushed_revision
|
19
19
|
|
20
20
|
def initialize(git_local_path, remote_name, source_ref, target_ref)
|
21
|
-
@git = ::
|
21
|
+
@git = ::Avm::Launcher::Git::Base.new(git_local_path)
|
22
22
|
@remote_name = remote_name
|
23
23
|
@source_ref = source_ref
|
24
24
|
@target_ref = target_ref
|
@@ -1,21 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'avmtrf1/core_ext'
|
4
4
|
|
5
5
|
module Avmtrf1
|
6
6
|
module Git
|
7
7
|
class PushLarge
|
8
8
|
class LfsCommit
|
9
|
-
|
10
|
-
|
9
|
+
require_sub __FILE__, include_modules: true
|
10
|
+
enable_simple_cache
|
11
|
+
enable_speaker
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
attr_reader :source_commit, :lfs_file_min_size, :tracked_files
|
15
|
-
|
16
|
-
def initialize(source_commit, lfs_file_min_size)
|
17
|
-
@source_commit = source_commit
|
18
|
-
@lfs_file_min_size = lfs_file_min_size
|
13
|
+
common_constructor :source_commit, :lfs_file_min_size do
|
19
14
|
@tracked_files = 0
|
20
15
|
@commit = nil
|
21
16
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Avmtrf1
|
4
|
+
module Git
|
5
|
+
class PushLarge
|
6
|
+
class LfsCommit
|
7
|
+
module Cache
|
8
|
+
def fs_cache_uncached
|
9
|
+
source_commit.fs_cache.child(lfs_file_min_size.present? ? lfs_file_min_size : 'nil')
|
10
|
+
end
|
11
|
+
|
12
|
+
%w[sha1 files_size push_pack_error].each do |attr|
|
13
|
+
define_method("#{attr}_cache_uncached") { fs_cache.child(attr) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Avmtrf1
|
4
|
+
module Git
|
5
|
+
class PushLarge
|
6
|
+
class LfsCommit
|
7
|
+
module CheckoutPreviousRevision
|
8
|
+
private
|
9
|
+
|
10
|
+
def checkout_base_uncached
|
11
|
+
if previous_revision.blank?
|
12
|
+
checkout_orphan
|
13
|
+
else
|
14
|
+
checkout_previous_revision
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def checkout_orphan
|
19
|
+
infom message('Checkout orphan')
|
20
|
+
git.execute!('reset', '--hard')
|
21
|
+
git.execute!('clean', '-df')
|
22
|
+
git.execute!('checkout', source_commit.sha1)
|
23
|
+
end
|
24
|
+
|
25
|
+
def checkout_previous_revision
|
26
|
+
infom message("Checkout previous revision #{previous_revision}")
|
27
|
+
git.execute!('reset', '--hard')
|
28
|
+
git.execute!('clean', '-df')
|
29
|
+
git.execute!('checkout', previous_revision)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Avmtrf1
|
4
|
+
module Git
|
5
|
+
class PushLarge
|
6
|
+
class LfsCommit
|
7
|
+
module CommitChanges
|
8
|
+
# @return [Avm::Git::Commit]
|
9
|
+
def commit
|
10
|
+
commit_changes
|
11
|
+
@commit
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def commit_changes_uncached
|
17
|
+
if sha1_cache.read.present?
|
18
|
+
@commit = ::Avm::Git::Commit.new(git, sha1_cache.read)
|
19
|
+
return
|
20
|
+
end
|
21
|
+
track_large_files
|
22
|
+
add_files
|
23
|
+
commit_amend
|
24
|
+
store_commit
|
25
|
+
end
|
26
|
+
|
27
|
+
def add_files
|
28
|
+
infom ' * Adding files'
|
29
|
+
git.system!('add', '.')
|
30
|
+
end
|
31
|
+
|
32
|
+
def commit_amend
|
33
|
+
infom message('Commiting')
|
34
|
+
git.command('commit', '--amend', '--allow-empty', '--allow-empty-message')
|
35
|
+
.envvar('GIT_EDITOR', true).execute!
|
36
|
+
end
|
37
|
+
|
38
|
+
def store_commit
|
39
|
+
@commit = ::Avm::Git::Commit.new(git, git.rev_parse('HEAD'))
|
40
|
+
infov message('Commited (SHA1)'), @commit.sha1
|
41
|
+
sha1_cache.write(@commit.sha1)
|
42
|
+
files_size_cache.write(@commit.files_size)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Avmtrf1
|
4
|
+
module Git
|
5
|
+
class PushLarge
|
6
|
+
class LfsCommit
|
7
|
+
module Helpers
|
8
|
+
private
|
9
|
+
|
10
|
+
def message(suffix, padding = 0)
|
11
|
+
"#{(' ' * (padding + 2))}* #{suffix}"
|
12
|
+
end
|
13
|
+
|
14
|
+
def git
|
15
|
+
source_commit.git
|
16
|
+
end
|
17
|
+
|
18
|
+
def push_large
|
19
|
+
source_commit.push_large
|
20
|
+
end
|
21
|
+
|
22
|
+
def previous_revision
|
23
|
+
push_large.last_pushed_revision
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Avmtrf1
|
4
|
+
module Git
|
5
|
+
class PushLarge
|
6
|
+
class LfsCommit
|
7
|
+
module PickSourceRevision
|
8
|
+
private
|
9
|
+
|
10
|
+
def add_cacheinfo_fail?(result)
|
11
|
+
!result.fetch(:exit_code).zero? && result.fetch(:stderr).include?('add_cacheinfo')
|
12
|
+
end
|
13
|
+
|
14
|
+
def cherry_pick_source_revision_uncached
|
15
|
+
checkout_base
|
16
|
+
return unless previous_revision.present?
|
17
|
+
|
18
|
+
infom message("Cherry pick #{source_commit.sha1}")
|
19
|
+
result = git.execute('cherry-pick', '--allow-empty', '--allow-empty-message',
|
20
|
+
'-Xtheirs', source_commit.sha1)
|
21
|
+
check_cherry_pick_result(result)
|
22
|
+
end
|
23
|
+
|
24
|
+
def check_cherry_pick_result(result)
|
25
|
+
return if result.fetch(:exit_code).zero?
|
26
|
+
return on_cherry_pick_conflict if cherry_pick_conflict?
|
27
|
+
return on_add_cacheinfo_fail if add_cacheinfo_fail?(result)
|
28
|
+
|
29
|
+
raise "Cherry pick failed: #{result}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def cherry_pick_conflict?
|
33
|
+
::File.exist?(::File.join(git, '.git', 'CHERRY_PICK_HEAD'))
|
34
|
+
end
|
35
|
+
|
36
|
+
def on_add_cacheinfo_fail
|
37
|
+
warn message('"add_cacheinfo" fail')
|
38
|
+
end
|
39
|
+
|
40
|
+
def on_cherry_pick_conflict
|
41
|
+
warn message('Cherry pick failed with conflict')
|
42
|
+
resolve_cherry_pick_conflicts
|
43
|
+
|
44
|
+
check_dirty_files
|
45
|
+
check_cherry_continue
|
46
|
+
end
|
47
|
+
|
48
|
+
def resolve_cherry_pick_conflicts
|
49
|
+
git.status_files.each do |scf|
|
50
|
+
if scf.dirty == 'D'
|
51
|
+
remove_file(scf.path)
|
52
|
+
elsif scf.dirty.present?
|
53
|
+
add_file(scf.path)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def remove_file(path)
|
59
|
+
infov message('Removing file'), path
|
60
|
+
git.execute!('rm', path)
|
61
|
+
end
|
62
|
+
|
63
|
+
def add_file(path)
|
64
|
+
infov message('Adding file'), path
|
65
|
+
git.execute!('add', path)
|
66
|
+
end
|
67
|
+
|
68
|
+
def check_dirty_files
|
69
|
+
infom message('Checking dirty files...')
|
70
|
+
df = dirty_files
|
71
|
+
infov message('Dirty files?'), df.any?
|
72
|
+
return unless df.any?
|
73
|
+
|
74
|
+
df.each do |f|
|
75
|
+
infov message(f.path, 1), "|#{f.stage}|#{f.dirty}|"
|
76
|
+
end
|
77
|
+
raise 'There are dirty files'
|
78
|
+
end
|
79
|
+
|
80
|
+
def dirty_files
|
81
|
+
git.status_files.select { |scf| scf.dirty.present? }
|
82
|
+
end
|
83
|
+
|
84
|
+
def check_cherry_continue
|
85
|
+
infom message('Continuing cherry pick')
|
86
|
+
git.execute!('-c', "core.editor=#{bash_editor}", 'cherry-pick', '--continue')
|
87
|
+
raise 'Still in cherry-pick conflict' if cherry_pick_conflict?
|
88
|
+
|
89
|
+
infom message('Cherry pick continue successful')
|
90
|
+
end
|
91
|
+
|
92
|
+
def bash_editor
|
93
|
+
if source_commit.subject.present?
|
94
|
+
'true'
|
95
|
+
else
|
96
|
+
'bash -c "printf \\"Mensagem original em branco.\\n\\" > $1"'
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Avmtrf1
|
4
|
+
module Git
|
5
|
+
class PushLarge
|
6
|
+
class LfsCommit
|
7
|
+
module Push
|
8
|
+
private
|
9
|
+
|
10
|
+
PACK_ERROR_MESSAGE = 'pack exceeds maximum allowed size'
|
11
|
+
PACK_ERROR_TRUE = 'true'
|
12
|
+
PACK_ERROR_FALSE = 'false'
|
13
|
+
|
14
|
+
def push_ok_uncached
|
15
|
+
commit
|
16
|
+
fresh_push if push_pack_error_cache.read.blank?
|
17
|
+
after_push_banner
|
18
|
+
push_pack_error_cache.read != PACK_ERROR_TRUE
|
19
|
+
end
|
20
|
+
|
21
|
+
def after_push_banner
|
22
|
+
infov message('Commit SHA1'), commit.sha1
|
23
|
+
raise 'Cache of files size not found' if files_size_cache.read.blank?
|
24
|
+
|
25
|
+
infov message('Files size'), PushLarge.bytes_size(files_size_cache.read)
|
26
|
+
end
|
27
|
+
|
28
|
+
def fresh_push
|
29
|
+
fresh_push_banner
|
30
|
+
check_push_result(
|
31
|
+
git.execute(
|
32
|
+
'push', push_large.remote_name, '--force',
|
33
|
+
"#{commit.sha1}:#{push_reference}"
|
34
|
+
)
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
def fresh_push_banner
|
39
|
+
infom message('Pushing...')
|
40
|
+
fresh_push_commit_banner
|
41
|
+
fresh_push_remote_banner
|
42
|
+
end
|
43
|
+
|
44
|
+
def fresh_push_commit_banner
|
45
|
+
infov message('SHA1', 1), commit.sha1
|
46
|
+
infov message('Files size', 1), PushLarge.bytes_size(commit.files_size)
|
47
|
+
end
|
48
|
+
|
49
|
+
def fresh_push_remote_banner
|
50
|
+
infov message('Remote', 1), push_large.remote_name
|
51
|
+
infov message('Reference', 1), push_reference
|
52
|
+
end
|
53
|
+
|
54
|
+
def push_reference
|
55
|
+
"refs/heads/#{push_large.target_ref}"
|
56
|
+
end
|
57
|
+
|
58
|
+
def check_push_result(result)
|
59
|
+
if result.fetch(:exit_code).zero?
|
60
|
+
on_push_result_ok
|
61
|
+
elsif result.fetch(:stderr).include?(PACK_ERROR_MESSAGE)
|
62
|
+
on_push_result_pack_error
|
63
|
+
else
|
64
|
+
on_push_result_arbitrary_error(result)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def on_push_result_ok
|
69
|
+
push_pack_error_cache.write(PACK_ERROR_FALSE)
|
70
|
+
success(push_message('successful'))
|
71
|
+
end
|
72
|
+
|
73
|
+
def on_push_result_pack_error
|
74
|
+
push_pack_error_cache.write(PACK_ERROR_TRUE)
|
75
|
+
warn(push_message("failed with message \"#{PACK_ERROR_MESSAGE}\""))
|
76
|
+
end
|
77
|
+
|
78
|
+
def on_push_result_arbitrary_error(result)
|
79
|
+
raise result.pretty_inspect.to_s
|
80
|
+
end
|
81
|
+
|
82
|
+
def push_message(suffix)
|
83
|
+
message("Push of #{commit.sha1} (Size: #{commit.files_size}, " \
|
84
|
+
"Files: #{commit.files.count}): #{suffix}.")
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|