eac_tools 0.86.3 → 0.86.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -27
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +2 -1
- data/sub/avm/lib/avm/scms/base.rb +5 -0
- data/sub/avm/lib/avm/sources/base.rb +5 -0
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/{avm-tools → avm}/spec/lib/avm/launcher/context_spec.rb +7 -7
- data/sub/avm/spec/spec_helper/eac_launcher/settings.yml +6 -0
- data/sub/avm/spec/spec_helper.rb +1 -0
- data/sub/avm-git/avm-git.gemspec +3 -1
- data/sub/avm-git/lib/avm/git/issue/complete/tracker.rb +0 -7
- data/sub/avm-git/lib/avm/git/issue/complete.rb +9 -6
- data/sub/{avm-tools/lib/avm/tools/runner/git → avm-git/lib/avm/git/runners/base}/commit.rb +3 -3
- data/sub/{avm-tools/lib/avm/tools/runner/git → avm-git/lib/avm/git/runners/base}/deploy.rb +3 -3
- data/sub/{avm-tools/lib/avm/tools/runner/git → avm-git/lib/avm/git/runners/base}/dirty_files.rb +4 -4
- data/sub/{avm-tools/lib/avm/tools/runner/git → avm-git/lib/avm/git/runners/base}/organize.rb +3 -3
- data/sub/{avm-tools/lib/avm/tools/runner/git → avm-git/lib/avm/git/runners/base}/revisions_test.rb +4 -4
- data/sub/{avm-tools/lib/avm/tools/runner/git → avm-git/lib/avm/git/runners/base}/subrepo/check.rb +4 -4
- data/sub/{avm-tools/lib/avm/tools/runner/git → avm-git/lib/avm/git/runners/base}/subrepo/clone.rb +4 -4
- data/sub/{avm-tools/lib/avm/tools/runner/git → avm-git/lib/avm/git/runners/base}/subrepo/fix.rb +4 -4
- data/sub/{avm-tools/lib/avm/tools/runner/git → avm-git/lib/avm/git/runners/base}/subrepo.rb +4 -4
- data/sub/{avm-tools/lib/avm/tools/runner/git.rb → avm-git/lib/avm/git/runners/base.rb} +11 -4
- data/sub/{avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0.rb → avm-git/lib/avm/git/runners.rb} +4 -2
- data/sub/avm-git/lib/avm/git/scms/git.rb +7 -0
- data/sub/avm-git/lib/avm/git/version.rb +1 -1
- data/sub/{avm-tools → avm-git}/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec.rb +4 -4
- data/sub/{avm-tools/spec/lib/avm/tools/runner/git → avm-git/spec/lib/avm/git/runners/base}/deploy_spec.rb +20 -20
- data/sub/avm-git/spec/spec_helper/eac_launcher.rb +50 -0
- data/sub/avm-git/spec/spec_helper.rb +2 -1
- data/sub/avm-tools/avm-tools.gemspec +3 -12
- data/sub/avm-tools/lib/avm/tools/runner/files/format.rb +8 -8
- data/sub/avm-tools/lib/avm/tools/runner/source/issue/complete.rb +13 -7
- data/sub/avm-tools/lib/avm/tools/runner/source/issue.rb +1 -1
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- data/sub/avm-tools/lib/avm/tools.rb +3 -2
- data/sub/avm-tools/spec/spec_helper.rb +0 -3
- metadata +46 -54
- data/sub/avm-eac_postgresql_base0/Gemfile +0 -8
- data/sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec +0 -20
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/assert.rb +0 -77
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/commands.rb +0 -79
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/data_unit.rb +0 -65
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb +0 -49
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance_with.rb +0 -25
- data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/version.rb +0 -7
- data/sub/avm-eac_postgresql_base0/spec/rubocop_spec.rb +0 -3
- data/sub/avm-eac_postgresql_base0/spec/spec_helper.rb +0 -4
- /data/sub/{avm-tools → avm}/spec/dummy/avm-tools_stub/avm-tools.gemspec +0 -0
- /data/sub/{avm-tools → avm}/spec/dummy/avm-tools_stub/lib/avm/tools/version.rb +0 -0
- /data/sub/{avm-tools → avm}/spec/dummy/avm-tools_stub/lib/avm/tools.rb +0 -0
- /data/sub/{avm-tools → avm}/spec/dummy/ruby_gem_stub/lib/ruby_gem_stub/version.rb +0 -0
- /data/sub/{avm-tools → avm}/spec/dummy/ruby_gem_stub/lib/ruby_gem_stub.rb +0 -0
- /data/sub/{avm-tools → avm}/spec/dummy/ruby_gem_stub/ruby_gem_stub.gemspec +0 -0
- /data/sub/{avm-tools → avm}/spec/lib/avm/launcher/context_spec.yml +0 -0
- /data/sub/{avm-tools → avm}/spec/spec_helper/eac_launcher.rb +0 -0
- /data/sub/{avm-tools → avm}/template/avm/self/docker_image/Dockerfile +0 -0
- /data/sub/{avm-tools → avm}/template/avm/self/docker_image/entrypoint.sh +0 -0
- /data/sub/{avm-tools → avm-git}/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_settings.yml +0 -0
- /data/sub/{avm-tools → avm-git}/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec.rb +0 -0
- /data/sub/{avm-tools → avm-git}/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_settings.yml +0 -0
- /data/sub/{avm-tools/spec/lib/avm/tools/runner/git → avm-git/spec/lib/avm/git/runners/base}/deploy_spec_files/append1/stub3.txt.template +0 -0
- /data/sub/{avm-tools/spec/lib/avm/tools/runner/git → avm-git/spec/lib/avm/git/runners/base}/deploy_spec_files/append2/stub4.txt +0 -0
- /data/sub/{avm-tools → avm-git}/spec/spec_helper/eac_launcher/settings.yml +0 -0
@@ -1,17 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/eac_ubuntu_base0/rspec/ssh_docker_server'
|
4
|
-
require 'avm/
|
4
|
+
require 'avm/git/runners/base'
|
5
5
|
require 'tmpdir'
|
6
6
|
|
7
|
-
RSpec.describe Avm::
|
7
|
+
RSpec.describe Avm::Git::Runners::Base::Deploy, :git do
|
8
8
|
let(:git) { stubbed_git_local_repo }
|
9
9
|
let(:reference) { git.current_branch }
|
10
|
-
let(:stub_file1) { 'stub1.txt' }
|
11
|
-
let(:stub_content1) { 'CONTENT 111' }
|
12
|
-
let(:stub_file2) { 'stub2.txt' }
|
13
|
-
let(:stub_content2) { 'CONTENT 222' }
|
14
|
-
let(:commit_sha1) do
|
10
|
+
let(:stub_file1) { 'stub1.txt' }
|
11
|
+
let(:stub_content1) { 'CONTENT 111' }
|
12
|
+
let(:stub_file2) { 'stub2.txt' }
|
13
|
+
let(:stub_content2) { 'CONTENT 222' }
|
14
|
+
let(:commit_sha1) do
|
15
15
|
git.file(stub_file1).write(stub_content1)
|
16
16
|
git.command('add', stub_file1).execute!
|
17
17
|
git.command('commit', '-m', 'First commit.').execute!
|
@@ -22,7 +22,7 @@ RSpec.describe Avm::Tools::Runner::Git::Deploy, :git do # rubocop:disable RSpec/
|
|
22
22
|
end
|
23
23
|
let(:target_dir) { File.join(Dir.mktmpdir, 'target') }
|
24
24
|
|
25
|
-
let(:commit_sha2) do
|
25
|
+
let(:commit_sha2) do
|
26
26
|
git.command('checkout', commit_sha1).execute!
|
27
27
|
git.file(stub_file1).delete
|
28
28
|
git.file(stub_file2).write(stub_content2)
|
@@ -31,10 +31,10 @@ RSpec.describe Avm::Tools::Runner::Git::Deploy, :git do # rubocop:disable RSpec/
|
|
31
31
|
git.rev_parse('HEAD')
|
32
32
|
end
|
33
33
|
|
34
|
-
let(:target_stub_file1) { File.join(target_dir, stub_file1) }
|
35
|
-
let(:target_stub_file2) { File.join(target_dir, stub_file2) }
|
34
|
+
let(:target_stub_file1) { File.join(target_dir, stub_file1) }
|
35
|
+
let(:target_stub_file2) { File.join(target_dir, stub_file2) }
|
36
36
|
|
37
|
-
context 'with local target' do
|
37
|
+
context 'with local target' do
|
38
38
|
before do
|
39
39
|
commit_sha1
|
40
40
|
avm_tools_runner_run(target_dir)
|
@@ -43,7 +43,7 @@ RSpec.describe Avm::Tools::Runner::Git::Deploy, :git do # rubocop:disable RSpec/
|
|
43
43
|
it { expect(File.read(target_stub_file1)).to eq(stub_content1) }
|
44
44
|
it { expect(File.exist?(target_stub_file2)).to be(false) }
|
45
45
|
|
46
|
-
context 'with second commit' do
|
46
|
+
context 'with second commit' do
|
47
47
|
before do
|
48
48
|
commit_sha2
|
49
49
|
avm_tools_runner_run(target_dir)
|
@@ -54,9 +54,9 @@ RSpec.describe Avm::Tools::Runner::Git::Deploy, :git do # rubocop:disable RSpec/
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
context 'with append directories' do
|
58
|
-
let(:target_stub_file3) { File.join(target_dir, 'stub3.txt') }
|
59
|
-
let(:target_stub_file4) { File.join(target_dir, 'stub4.txt') }
|
57
|
+
context 'with append directories' do
|
58
|
+
let(:target_stub_file3) { File.join(target_dir, 'stub3.txt') }
|
59
|
+
let(:target_stub_file4) { File.join(target_dir, 'stub4.txt') }
|
60
60
|
|
61
61
|
before do
|
62
62
|
EacConfig::Node.context.current.entry('my_value').value = '123'
|
@@ -70,9 +70,9 @@ RSpec.describe Avm::Tools::Runner::Git::Deploy, :git do # rubocop:disable RSpec/
|
|
70
70
|
it { expect(File.read(target_stub_file4)).to eq("MyValue: %%MY_VALUE%%\n") }
|
71
71
|
end
|
72
72
|
|
73
|
-
context 'with instance' do
|
74
|
-
let(:target_stub_file3) { File.join(target_dir, 'stub3.txt') }
|
75
|
-
let(:target_stub_file4) { File.join(target_dir, 'stub4.txt') }
|
73
|
+
context 'with instance' do
|
74
|
+
let(:target_stub_file3) { File.join(target_dir, 'stub3.txt') }
|
75
|
+
let(:target_stub_file4) { File.join(target_dir, 'stub4.txt') }
|
76
76
|
|
77
77
|
before do
|
78
78
|
EacConfig::Node.context.current.entry('my-instance_dev.my_value').value = '123'
|
@@ -86,7 +86,7 @@ RSpec.describe Avm::Tools::Runner::Git::Deploy, :git do # rubocop:disable RSpec/
|
|
86
86
|
it { expect(File.read(target_stub_file4)).to eq("MyValue: %%MY_VALUE%%\n") }
|
87
87
|
end
|
88
88
|
|
89
|
-
context 'with ssh target', :docker do
|
89
|
+
context 'with ssh target', :docker do
|
90
90
|
let(:ssh_server) { Avm::EacUbuntuBase0::Rspec::SshDockerServer.new }
|
91
91
|
let(:env) { ssh_server.env }
|
92
92
|
let(:tmpdir) { env.command('mktemp', '-d').execute! }
|
@@ -109,7 +109,7 @@ RSpec.describe Avm::Tools::Runner::Git::Deploy, :git do # rubocop:disable RSpec/
|
|
109
109
|
it { expect(env.file(target_stub_file1).read).to eq(stub_content1) }
|
110
110
|
it { expect(env.file(target_stub_file2).exist?).to be(false) }
|
111
111
|
|
112
|
-
context 'with second commit' do
|
112
|
+
context 'with second commit' do
|
113
113
|
before do
|
114
114
|
commit_sha2
|
115
115
|
avm_tools_runner_run(target_url)
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
ROOT_DIR = File.expand_path('../..', __dir__)
|
4
|
+
|
5
|
+
require 'avm/launcher/context'
|
6
|
+
|
7
|
+
RSpec.configure do |config|
|
8
|
+
config.before do
|
9
|
+
require 'avm/launcher/context'
|
10
|
+
Avm::Launcher::Context.current = Avm::Launcher::Context.new(
|
11
|
+
settings_file: File.join(__dir__, 'eac_launcher', 'settings.yml'),
|
12
|
+
cache_root: Dir.mktmpdir
|
13
|
+
)
|
14
|
+
@remotes_dir = Dir.mktmpdir
|
15
|
+
allow(ProgressBar).to receive(:create).and_return(double.as_null_object)
|
16
|
+
end
|
17
|
+
|
18
|
+
def temp_context(settings_path)
|
19
|
+
require 'avm/launcher/context'
|
20
|
+
require 'tmpdir'
|
21
|
+
Avm::Launcher::Context.current = Avm::Launcher::Context.new(
|
22
|
+
projects_root: Dir.mktmpdir, settings_file: settings_path, cache_root: Dir.mktmpdir
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
def init_remote(name)
|
27
|
+
require 'avm/git/launcher/base'
|
28
|
+
r = Avm::Git::Launcher::Base.new(File.join(@remotes_dir, name))
|
29
|
+
r.init_bare
|
30
|
+
r
|
31
|
+
end
|
32
|
+
|
33
|
+
def init_git(subdir)
|
34
|
+
require 'avm/git/launcher/base'
|
35
|
+
r = Avm::Git::Launcher::Base.new(File.join(Avm::Launcher::Context.current.root.real,
|
36
|
+
subdir))
|
37
|
+
r.git
|
38
|
+
r.execute!('config', 'user.email', 'theuser@example.net')
|
39
|
+
r.execute!('config', 'user.name', 'The User')
|
40
|
+
r
|
41
|
+
end
|
42
|
+
|
43
|
+
def touch_commit(repos, subpath)
|
44
|
+
require 'fileutils'
|
45
|
+
FileUtils.mkdir_p(File.dirname(repos.subpath(subpath)))
|
46
|
+
FileUtils.touch(repos.subpath(subpath))
|
47
|
+
repos.execute!('add', repos.subpath(subpath))
|
48
|
+
repos.execute!('commit', '-m', subpath)
|
49
|
+
end
|
50
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/rspec/default_setup'
|
4
|
-
EacRubyUtils::Rspec.default_setup_create(File.expand_path('..', __dir__))
|
4
|
+
EacRubyUtils::Rspec.default_setup_create(File.expand_path('..', __dir__)).stub_avm_contexts
|
5
|
+
EacRubyUtils.require_sub(__FILE__)
|
@@ -10,25 +10,16 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.authors = ['Esquilo Azul Company']
|
11
11
|
s.summary = 'Tools for AVM.'
|
12
12
|
|
13
|
-
s.files = Dir['{exe,lib
|
13
|
+
s.files = Dir['{exe,lib}/**/*', 'Gemfile']
|
14
14
|
s.bindir = 'exe'
|
15
15
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
16
16
|
|
17
17
|
s.required_ruby_version = '>= 2.7.0'
|
18
18
|
|
19
|
-
s.add_dependency '
|
20
|
-
s.add_dependency 'avm', '~> 0.85'
|
21
|
-
s.add_dependency 'avm-eac_ruby_base1', '~> 0.33', '>= 0.33.1'
|
22
|
-
s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.5'
|
23
|
-
s.add_dependency 'avm-files', '~> 0.7'
|
24
|
-
s.add_dependency 'avm-git', '~> 0.15'
|
19
|
+
s.add_dependency 'avm', '~> 0.86', '>= 0.86.1'
|
25
20
|
s.add_dependency 'clipboard', '~> 1.3', '>= 1.3.6'
|
26
|
-
s.add_dependency 'curb', '~> 0.9', '>= 0.9.11'
|
27
|
-
s.add_dependency 'eac_git', '~> 0.16'
|
28
21
|
s.add_dependency 'eac_ruby_base0', '~> 0.19'
|
29
|
-
s.add_dependency 'eac_templates', '~> 0.5', '>= 0.5.1'
|
30
|
-
s.add_dependency 'git', '~> 1.19', '>= 1.19.1'
|
31
|
-
s.add_dependency 'ruby-progressbar', '~> 1.13'
|
32
22
|
|
23
|
+
s.add_development_dependency 'avm-git', '~> 0.17'
|
33
24
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.8.1'
|
34
25
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/file_formats/search_formatter'
|
4
|
+
require 'avm/registry'
|
4
5
|
require 'eac_cli/core_ext'
|
5
|
-
require 'avm/git/launcher/base'
|
6
6
|
|
7
7
|
module Avm
|
8
8
|
module Tools
|
@@ -14,7 +14,7 @@ module Avm
|
|
14
14
|
bool_opt '-a', '--apply', 'Confirm changes.'
|
15
15
|
bool_opt '-n', '--no-recursive', 'No recursive.'
|
16
16
|
bool_opt '-v', '--verbose', 'Verbose'
|
17
|
-
bool_opt '-d', '--
|
17
|
+
bool_opt '-d', '--dirty', 'Select modified files to format.'
|
18
18
|
pos_arg :paths, repeat: true, optional: true
|
19
19
|
end
|
20
20
|
|
@@ -28,17 +28,17 @@ module Avm
|
|
28
28
|
::Avm::FileFormats::SearchFormatter::OPTION_VERBOSE => parsed.verbose? }
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
32
|
-
@
|
31
|
+
def scm
|
32
|
+
@scm ||= ::Avm::Registry.scms.detect('.')
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
36
|
-
|
35
|
+
def dirty_files
|
36
|
+
scm.dirty_files.map { |f| scm.root_path.join(f.path) }.select(&:exist?).map(&:to_s)
|
37
37
|
end
|
38
38
|
|
39
39
|
def source_paths
|
40
|
-
if parsed.
|
41
|
-
parsed.paths +
|
40
|
+
if parsed.dirty?
|
41
|
+
parsed.paths + dirty_files
|
42
42
|
else
|
43
43
|
parsed.paths.if_present(%w[.])
|
44
44
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/tools/core_ext'
|
4
|
-
require '
|
4
|
+
require 'clipboard'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Tools
|
@@ -10,7 +10,7 @@ module Avm
|
|
10
10
|
class Issue
|
11
11
|
class Complete
|
12
12
|
runner_with :confirmation, :help do
|
13
|
-
desc 'Closes a issue in a
|
13
|
+
desc 'Closes a issue in a remote repository.'
|
14
14
|
bool_opt '-f', '--uncomplete-unfail', 'Do not exit with error if issue is not ' \
|
15
15
|
'completed or is invalid.'
|
16
16
|
arg_opt '-s', '--skip-validations', 'Does not validate conditions on <validations> ' \
|
@@ -21,6 +21,8 @@ module Avm
|
|
21
21
|
return unless run_validate
|
22
22
|
return unless run_complete
|
23
23
|
|
24
|
+
clipboard_copy_tracker_message
|
25
|
+
|
24
26
|
success('Done!')
|
25
27
|
end
|
26
28
|
|
@@ -43,21 +45,25 @@ module Avm
|
|
43
45
|
|
44
46
|
private
|
45
47
|
|
48
|
+
def clipboard_copy_tracker_message
|
49
|
+
::Clipboard.copy(complete.textile_tracker_message)
|
50
|
+
infov 'Copied to clipboard', complete.textile_tracker_message
|
51
|
+
end
|
52
|
+
|
46
53
|
def complete_uncached
|
47
|
-
|
54
|
+
runner_context.call(:subject).completer(complete_issue_options)
|
48
55
|
end
|
49
56
|
|
50
57
|
def skip_validations
|
51
58
|
parsed.skip_validations.to_s.split(',').map(&:strip).compact_blank
|
52
59
|
end
|
53
60
|
|
54
|
-
def
|
55
|
-
{
|
56
|
-
skip_validations: skip_validations }
|
61
|
+
def complete_issue_options
|
62
|
+
{ skip_validations: skip_validations }
|
57
63
|
end
|
58
64
|
|
59
65
|
def doc_validations_list
|
60
|
-
|
66
|
+
complete.validation_keys.map { |k| " * #{k}" }.join("\n")
|
61
67
|
end
|
62
68
|
|
63
69
|
def uncomplete_unfail?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.86.
|
4
|
+
version: 0.86.5
|
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: 2024-02-
|
11
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avm
|
@@ -16,14 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.86'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.86.1
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
29
|
+
version: '0.86'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.86.1
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: avm-eac_asciidoctor_base0
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -288,34 +294,28 @@ dependencies:
|
|
288
294
|
requirements:
|
289
295
|
- - "~>"
|
290
296
|
- !ruby/object:Gem::Version
|
291
|
-
version: '0.
|
297
|
+
version: '0.17'
|
292
298
|
type: :runtime
|
293
299
|
prerelease: false
|
294
300
|
version_requirements: !ruby/object:Gem::Requirement
|
295
301
|
requirements:
|
296
302
|
- - "~>"
|
297
303
|
- !ruby/object:Gem::Version
|
298
|
-
version: '0.
|
304
|
+
version: '0.17'
|
299
305
|
- !ruby/object:Gem::Dependency
|
300
306
|
name: avm-tools
|
301
307
|
requirement: !ruby/object:Gem::Requirement
|
302
308
|
requirements:
|
303
309
|
- - "~>"
|
304
310
|
- !ruby/object:Gem::Version
|
305
|
-
version: '0.
|
306
|
-
- - ">="
|
307
|
-
- !ruby/object:Gem::Version
|
308
|
-
version: 0.160.1
|
311
|
+
version: '0.161'
|
309
312
|
type: :runtime
|
310
313
|
prerelease: false
|
311
314
|
version_requirements: !ruby/object:Gem::Requirement
|
312
315
|
requirements:
|
313
316
|
- - "~>"
|
314
317
|
- !ruby/object:Gem::Version
|
315
|
-
version: '0.
|
316
|
-
- - ">="
|
317
|
-
- !ruby/object:Gem::Version
|
318
|
-
version: 0.160.1
|
318
|
+
version: '0.161'
|
319
319
|
- !ruby/object:Gem::Dependency
|
320
320
|
name: eac_ruby_utils
|
321
321
|
requirement: !ruby/object:Gem::Requirement
|
@@ -354,17 +354,6 @@ files:
|
|
354
354
|
- Gemfile.lock
|
355
355
|
- lib/eac_tools.rb
|
356
356
|
- lib/eac_tools/version.rb
|
357
|
-
- sub/avm-eac_postgresql_base0/Gemfile
|
358
|
-
- sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec
|
359
|
-
- sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0.rb
|
360
|
-
- sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb
|
361
|
-
- sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/assert.rb
|
362
|
-
- sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/commands.rb
|
363
|
-
- sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/data_unit.rb
|
364
|
-
- sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance_with.rb
|
365
|
-
- sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/version.rb
|
366
|
-
- sub/avm-eac_postgresql_base0/spec/rubocop_spec.rb
|
367
|
-
- sub/avm-eac_postgresql_base0/spec/spec_helper.rb
|
368
357
|
- sub/avm-eac_redmine_plugin_base0/Gemfile
|
369
358
|
- sub/avm-eac_redmine_plugin_base0/avm-eac_redmine_plugin_base0.gemspec
|
370
359
|
- sub/avm-eac_redmine_plugin_base0/lib/avm/eac_redmine_plugin_base0.rb
|
@@ -466,6 +455,17 @@ files:
|
|
466
455
|
- sub/avm-git/lib/avm/git/organize/reference_update.rb
|
467
456
|
- sub/avm-git/lib/avm/git/organize/repository.rb
|
468
457
|
- sub/avm-git/lib/avm/git/revision_test.rb
|
458
|
+
- sub/avm-git/lib/avm/git/runners.rb
|
459
|
+
- sub/avm-git/lib/avm/git/runners/base.rb
|
460
|
+
- sub/avm-git/lib/avm/git/runners/base/commit.rb
|
461
|
+
- sub/avm-git/lib/avm/git/runners/base/deploy.rb
|
462
|
+
- sub/avm-git/lib/avm/git/runners/base/dirty_files.rb
|
463
|
+
- sub/avm-git/lib/avm/git/runners/base/organize.rb
|
464
|
+
- sub/avm-git/lib/avm/git/runners/base/revisions_test.rb
|
465
|
+
- sub/avm-git/lib/avm/git/runners/base/subrepo.rb
|
466
|
+
- sub/avm-git/lib/avm/git/runners/base/subrepo/check.rb
|
467
|
+
- sub/avm-git/lib/avm/git/runners/base/subrepo/clone.rb
|
468
|
+
- sub/avm-git/lib/avm/git/runners/base/subrepo/fix.rb
|
469
469
|
- sub/avm-git/lib/avm/git/scms.rb
|
470
470
|
- sub/avm-git/lib/avm/git/scms/git.rb
|
471
471
|
- sub/avm-git/lib/avm/git/scms/git/branch.rb
|
@@ -513,12 +513,21 @@ files:
|
|
513
513
|
- sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.target.yaml
|
514
514
|
- sub/avm-git/spec/lib/avm/git/commit_spec.rb
|
515
515
|
- sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb
|
516
|
+
- sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec.rb
|
517
|
+
- sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_settings.yml
|
518
|
+
- sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec.rb
|
519
|
+
- sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_settings.yml
|
520
|
+
- sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec.rb
|
521
|
+
- sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec_files/append1/stub3.txt.template
|
522
|
+
- sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec_files/append2/stub4.txt
|
516
523
|
- sub/avm-git/spec/lib/avm/git/scms/git/commit/deploy_spec.rb
|
517
524
|
- sub/avm-git/spec/lib/avm/git/scms/git_spec.rb
|
518
525
|
- sub/avm-git/spec/lib/avm/git/scms/git_subrepo_spec.rb
|
519
526
|
- sub/avm-git/spec/lib/avm/git/vendor/github_spec.rb
|
520
527
|
- sub/avm-git/spec/rubocop_spec.rb
|
521
528
|
- sub/avm-git/spec/spec_helper.rb
|
529
|
+
- sub/avm-git/spec/spec_helper/eac_launcher.rb
|
530
|
+
- sub/avm-git/spec/spec_helper/eac_launcher/settings.yml
|
522
531
|
- sub/avm-tools/Gemfile
|
523
532
|
- sub/avm-tools/README.textile
|
524
533
|
- sub/avm-tools/avm-tools.gemspec
|
@@ -542,16 +551,6 @@ files:
|
|
542
551
|
- sub/avm-tools/lib/avm/tools/runner/files.rb
|
543
552
|
- sub/avm-tools/lib/avm/tools/runner/files/format.rb
|
544
553
|
- sub/avm-tools/lib/avm/tools/runner/files/rotate.rb
|
545
|
-
- sub/avm-tools/lib/avm/tools/runner/git.rb
|
546
|
-
- sub/avm-tools/lib/avm/tools/runner/git/commit.rb
|
547
|
-
- sub/avm-tools/lib/avm/tools/runner/git/deploy.rb
|
548
|
-
- sub/avm-tools/lib/avm/tools/runner/git/dirty_files.rb
|
549
|
-
- sub/avm-tools/lib/avm/tools/runner/git/organize.rb
|
550
|
-
- sub/avm-tools/lib/avm/tools/runner/git/revisions_test.rb
|
551
|
-
- sub/avm-tools/lib/avm/tools/runner/git/subrepo.rb
|
552
|
-
- sub/avm-tools/lib/avm/tools/runner/git/subrepo/check.rb
|
553
|
-
- sub/avm-tools/lib/avm/tools/runner/git/subrepo/clone.rb
|
554
|
-
- sub/avm-tools/lib/avm/tools/runner/git/subrepo/fix.rb
|
555
554
|
- sub/avm-tools/lib/avm/tools/runner/instance.rb
|
556
555
|
- sub/avm-tools/lib/avm/tools/runner/instance/data.rb
|
557
556
|
- sub/avm-tools/lib/avm/tools/runner/instance/data/clear.rb
|
@@ -594,31 +593,12 @@ files:
|
|
594
593
|
- sub/avm-tools/lib/avm/tools/runner_with/instance_data_performer.rb
|
595
594
|
- sub/avm-tools/lib/avm/tools/self.rb
|
596
595
|
- sub/avm-tools/lib/avm/tools/version.rb
|
597
|
-
- sub/avm-tools/spec/dummy/avm-tools_stub/avm-tools.gemspec
|
598
|
-
- sub/avm-tools/spec/dummy/avm-tools_stub/lib/avm/tools.rb
|
599
|
-
- sub/avm-tools/spec/dummy/avm-tools_stub/lib/avm/tools/version.rb
|
600
|
-
- sub/avm-tools/spec/dummy/ruby_gem_stub/lib/ruby_gem_stub.rb
|
601
|
-
- sub/avm-tools/spec/dummy/ruby_gem_stub/lib/ruby_gem_stub/version.rb
|
602
|
-
- sub/avm-tools/spec/dummy/ruby_gem_stub/ruby_gem_stub.gemspec
|
603
|
-
- sub/avm-tools/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec.rb
|
604
|
-
- sub/avm-tools/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_settings.yml
|
605
|
-
- sub/avm-tools/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec.rb
|
606
|
-
- sub/avm-tools/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_settings.yml
|
607
|
-
- sub/avm-tools/spec/lib/avm/launcher/context_spec.rb
|
608
|
-
- sub/avm-tools/spec/lib/avm/launcher/context_spec.yml
|
609
596
|
- sub/avm-tools/spec/lib/avm/tools/runner/files/rotate_spec.rb
|
610
|
-
- sub/avm-tools/spec/lib/avm/tools/runner/git/deploy_spec.rb
|
611
|
-
- sub/avm-tools/spec/lib/avm/tools/runner/git/deploy_spec_files/append1/stub3.txt.template
|
612
|
-
- sub/avm-tools/spec/lib/avm/tools/runner/git/deploy_spec_files/append2/stub4.txt
|
613
597
|
- sub/avm-tools/spec/lib/avm/tools/runner/launcher_stereotypes/list_spec.rb
|
614
598
|
- sub/avm-tools/spec/lib/avm/tools/runner/source/issue/complete_spec.rb
|
615
599
|
- sub/avm-tools/spec/lib/avm/tools/runner_spec.rb
|
616
600
|
- sub/avm-tools/spec/rubocop_spec.rb
|
617
601
|
- sub/avm-tools/spec/spec_helper.rb
|
618
|
-
- sub/avm-tools/spec/spec_helper/eac_launcher.rb
|
619
|
-
- sub/avm-tools/spec/spec_helper/eac_launcher/settings.yml
|
620
|
-
- sub/avm-tools/template/avm/self/docker_image/Dockerfile
|
621
|
-
- sub/avm-tools/template/avm/self/docker_image/entrypoint.sh
|
622
602
|
- sub/avm/Gemfile
|
623
603
|
- sub/avm/avm.gemspec
|
624
604
|
- sub/avm/lib/avm.rb
|
@@ -835,6 +815,12 @@ files:
|
|
835
815
|
- sub/avm/lib/avm/with/extra_subcommands.rb
|
836
816
|
- sub/avm/locale/en.yml
|
837
817
|
- sub/avm/locale/pt-BR.yml
|
818
|
+
- sub/avm/spec/dummy/avm-tools_stub/avm-tools.gemspec
|
819
|
+
- sub/avm/spec/dummy/avm-tools_stub/lib/avm/tools.rb
|
820
|
+
- sub/avm/spec/dummy/avm-tools_stub/lib/avm/tools/version.rb
|
821
|
+
- sub/avm/spec/dummy/ruby_gem_stub/lib/ruby_gem_stub.rb
|
822
|
+
- sub/avm/spec/dummy/ruby_gem_stub/lib/ruby_gem_stub/version.rb
|
823
|
+
- sub/avm/spec/dummy/ruby_gem_stub/ruby_gem_stub.gemspec
|
838
824
|
- sub/avm/spec/lib/avm/applications/base/entries_spec.rb
|
839
825
|
- sub/avm/spec/lib/avm/applications/base/entries_spec_files/config.yml
|
840
826
|
- sub/avm/spec/lib/avm/applications/base_spec.rb
|
@@ -842,6 +828,8 @@ files:
|
|
842
828
|
- sub/avm/spec/lib/avm/file_formats/base_spec.rb
|
843
829
|
- sub/avm/spec/lib/avm/instances/base_spec.rb
|
844
830
|
- sub/avm/spec/lib/avm/instances/base_spec_files/config.yml
|
831
|
+
- sub/avm/spec/lib/avm/launcher/context_spec.rb
|
832
|
+
- sub/avm/spec/lib/avm/launcher/context_spec.yml
|
845
833
|
- sub/avm/spec/lib/avm/launcher/instances/base_spec.rb
|
846
834
|
- sub/avm/spec/lib/avm/launcher/instances/base_spec_files/projects/avm-tools_stub/avm-tools.gemspec
|
847
835
|
- sub/avm/spec/lib/avm/launcher/instances/base_spec_files/projects/avm-tools_stub/lib/avm/tools.rb
|
@@ -857,6 +845,10 @@ files:
|
|
857
845
|
- sub/avm/spec/lib/avm/sources/runner_spec.rb
|
858
846
|
- sub/avm/spec/rubocop_spec.rb
|
859
847
|
- sub/avm/spec/spec_helper.rb
|
848
|
+
- sub/avm/spec/spec_helper/eac_launcher.rb
|
849
|
+
- sub/avm/spec/spec_helper/eac_launcher/settings.yml
|
850
|
+
- sub/avm/template/avm/self/docker_image/Dockerfile
|
851
|
+
- sub/avm/template/avm/self/docker_image/entrypoint.sh
|
860
852
|
- sub/eac_git/Gemfile
|
861
853
|
- sub/eac_git/eac_git.gemspec
|
862
854
|
- sub/eac_git/lib/eac_git.rb
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
-
|
5
|
-
require 'avm/eac_postgresql_base0/version'
|
6
|
-
|
7
|
-
Gem::Specification.new do |s|
|
8
|
-
s.name = 'avm-eac_postgresql_base0'
|
9
|
-
s.version = Avm::EacPostgresqlBase0::VERSION
|
10
|
-
s.authors = ['Put here the authors']
|
11
|
-
s.summary = 'Put here de description.'
|
12
|
-
|
13
|
-
s.files = Dir['{lib}/**/*']
|
14
|
-
s.required_ruby_version = '>= 2.7'
|
15
|
-
|
16
|
-
s.add_dependency 'avm', '~> 0.85'
|
17
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.121'
|
18
|
-
|
19
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.10'
|
20
|
-
end
|
@@ -1,77 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module EacPostgresqlBase0
|
7
|
-
class Instance
|
8
|
-
class Assert
|
9
|
-
common_constructor :instance
|
10
|
-
delegate :name, :password, :user, to: :instance
|
11
|
-
|
12
|
-
def perform
|
13
|
-
create_user unless user_exist?
|
14
|
-
change_password unless password_ok?
|
15
|
-
create_database unless database_exist?
|
16
|
-
change_owner unless user_owner?
|
17
|
-
end
|
18
|
-
|
19
|
-
def change_owner
|
20
|
-
root_execute("ALTER DaTABASE \"#{name}\" OWNER TO \"#{user}\"")
|
21
|
-
end
|
22
|
-
|
23
|
-
def change_password
|
24
|
-
root_execute("ALTER USER \"#{user}\" WITH PASSWORD '#{password}'")
|
25
|
-
end
|
26
|
-
|
27
|
-
def create_user
|
28
|
-
root_execute("CREATE USER \"#{user}\" WITH PASSWORD '#{password}'")
|
29
|
-
end
|
30
|
-
|
31
|
-
def current_owner
|
32
|
-
root_query(<<~SQL.squish
|
33
|
-
SELECT pg_catalog.pg_get_userbyid(datdba)
|
34
|
-
FROM pg_catalog.pg_database
|
35
|
-
WHERE datname = '#{name}'
|
36
|
-
SQL
|
37
|
-
)
|
38
|
-
end
|
39
|
-
|
40
|
-
def database_exist?
|
41
|
-
root_boolean_query("FROM pg_database WHERE datname='#{name}'")
|
42
|
-
end
|
43
|
-
|
44
|
-
def password_ok?
|
45
|
-
instance.psql_command_command('SELECT 1', false)
|
46
|
-
.execute!(exit_outputs: { 512 => 'login_failed' }).strip == '1'
|
47
|
-
end
|
48
|
-
|
49
|
-
def user_exist?
|
50
|
-
root_boolean_query("FROM pg_roles WHERE rolname='#{user}'")
|
51
|
-
end
|
52
|
-
|
53
|
-
def user_owner?
|
54
|
-
user == current_owner
|
55
|
-
end
|
56
|
-
|
57
|
-
def create_database
|
58
|
-
root_execute("CREATE DATABASE \"#{name}\" WITH OWNER \"#{user}\"")
|
59
|
-
end
|
60
|
-
|
61
|
-
private
|
62
|
-
|
63
|
-
def root_boolean_query(sql_after_projection)
|
64
|
-
root_query("SELECT 1 #{sql_after_projection}") == '1'
|
65
|
-
end
|
66
|
-
|
67
|
-
def root_execute(sql)
|
68
|
-
instance.root_psql_command(sql).execute!
|
69
|
-
end
|
70
|
-
|
71
|
-
def root_query(sql)
|
72
|
-
root_execute(sql).strip
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|