avmtrf1-tools 0.33.0 → 0.34.0
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 +3 -2
- data/lib/avmtrf1/docker/image.rb +12 -0
- data/lib/avmtrf1/docker/image_runner.rb +83 -0
- data/lib/avmtrf1/forponto/user/month.rb +0 -1
- 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/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/lfs_commit.rb +5 -10
- data/lib/avmtrf1/git/push_large/source_commit/push.rb +42 -0
- data/lib/avmtrf1/git/push_large/source_commit.rb +4 -7
- data/lib/avmtrf1/git/push_large.rb +6 -6
- data/lib/avmtrf1/inventario_sistemas/site_build/html_page_base.rb +1 -1
- data/lib/avmtrf1/node_js/docker_image.rb +10 -0
- data/lib/avmtrf1/node_js.rb +9 -0
- data/lib/avmtrf1/patches/avm/git/issue.rb +4 -0
- data/lib/avmtrf1/patches/avm/git.rb +4 -0
- data/lib/avmtrf1/patches/avm/launcher/git/base.rb +46 -0
- data/lib/avmtrf1/patches/avm/launcher/git.rb +4 -0
- data/lib/avmtrf1/patches/avm/launcher.rb +4 -0
- data/lib/avmtrf1/patches/avm.rb +4 -0
- data/lib/avmtrf1/patches.rb +3 -0
- data/lib/avmtrf1/php/docker_image.rb +2 -19
- data/lib/avmtrf1/red/helper.rb +2 -2
- data/lib/avmtrf1/template.rb +2 -2
- data/lib/avmtrf1/tools/runner/check_point/login.rb +6 -19
- data/lib/avmtrf1/tools/runner/check_point.rb +7 -13
- data/lib/avmtrf1/tools/runner/esosti/changed.rb +9 -22
- data/lib/avmtrf1/tools/runner/esosti/fetch.rb +9 -22
- data/lib/avmtrf1/tools/runner/esosti/request.rb +17 -29
- data/lib/avmtrf1/tools/runner/esosti.rb +8 -20
- data/lib/avmtrf1/tools/runner/forponto/espelho.rb +11 -21
- data/lib/avmtrf1/tools/runner/forponto/marcacoes.rb +7 -18
- data/lib/avmtrf1/tools/runner/forponto/resumos.rb +7 -19
- data/lib/avmtrf1/tools/runner/forponto/saldo.rb +10 -21
- data/lib/avmtrf1/tools/runner/forponto.rb +13 -23
- data/lib/avmtrf1/tools/runner/git/issues_check.rb +7 -18
- data/lib/avmtrf1/tools/runner/git/push_large.rb +27 -18
- data/lib/avmtrf1/tools/runner/git.rb +2 -4
- data/lib/avmtrf1/tools/runner/node_js/docker.rb +15 -0
- data/lib/avmtrf1/tools/runner/node_js.rb +18 -0
- data/lib/avmtrf1/tools/runner/oracle/query.rb +9 -13
- data/lib/avmtrf1/tools/runner/oracle/source_get.rb +17 -18
- data/lib/avmtrf1/tools/runner/oracle/user_clear.rb +7 -15
- data/lib/avmtrf1/tools/runner/oracle.rb +15 -22
- data/lib/avmtrf1/tools/runner/php/docker.rb +3 -60
- data/lib/avmtrf1/tools/runner/red.rb +21 -25
- data/lib/avmtrf1/tools/runner/trf1_dspace_base0/deploy.rb +1 -1
- data/lib/avmtrf1/tools/runner/trf1_dspace_base0.rb +9 -18
- data/lib/avmtrf1/tools/runner.rb +5 -2
- data/lib/avmtrf1/tools/version.rb +1 -1
- data/template/avmtrf1/node_js/docker_image/Dockerfile.template +11 -0
- data/template/avmtrf1/node_js/docker_image/auxiliary/config_banner.sh +15 -0
- data/template/avmtrf1/node_js/docker_image/auxiliary/init.sh +17 -0
- data/template/avmtrf1/node_js/docker_image/auxiliary/lib.sh +30 -0
- data/template/avmtrf1/node_js/docker_image/auxiliary/ng_serve.sh +16 -0
- data/template/avmtrf1/node_js/docker_image/auxiliary/npm_install.sh +21 -0
- data/template/avmtrf1/node_js/docker_image/auxiliary/start.sh +17 -0
- data/template/avmtrf1/php/docker_image/Dockerfile.template +1 -1
- metadata +36 -102
- data/lib/avmtrf1/configs.rb +0 -24
- data/lib/avmtrf1/fs_cache.rb +0 -11
- 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
@@ -1,28 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require '
|
5
|
-
require 'eac_ruby_utils/simple_cache'
|
3
|
+
require 'avmtrf1/core_ext'
|
4
|
+
require 'avmtrf1/forponto/user/balance'
|
6
5
|
|
7
6
|
module Avmtrf1
|
8
7
|
module Tools
|
9
8
|
class Runner
|
10
|
-
class Forponto
|
11
|
-
class Saldo
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
Calcula saldo de horas atual.
|
17
|
-
|
18
|
-
Usage:
|
19
|
-
__PROGRAM__ [options]
|
20
|
-
__PROGRAM__ -h | --help
|
21
|
-
|
22
|
-
Options:
|
23
|
-
-h --help Show this screen.
|
24
|
-
-d --details Show details.
|
25
|
-
DOCOPT
|
9
|
+
class Forponto
|
10
|
+
class Saldo
|
11
|
+
runner_with :help do
|
12
|
+
desc 'Calcula saldo de horas atual.'
|
13
|
+
bool_opt '-d', '--details', 'Show details.'
|
14
|
+
end
|
26
15
|
|
27
16
|
def run
|
28
17
|
balance.months_balances.each do |mb|
|
@@ -47,7 +36,7 @@ module Avmtrf1
|
|
47
36
|
|
48
37
|
def show_month_attr_balance(mba, label)
|
49
38
|
infov " * #{label}", minutes_to_s(mba.initial_value)
|
50
|
-
return unless
|
39
|
+
return unless parsed.details?
|
51
40
|
|
52
41
|
show_month_withdrawals(mba)
|
53
42
|
show_month_requests(mba)
|
@@ -93,7 +82,7 @@ module Avmtrf1
|
|
93
82
|
end
|
94
83
|
|
95
84
|
def balance_uncached
|
96
|
-
::Avmtrf1::Forponto::User::Balance.new(
|
85
|
+
::Avmtrf1::Forponto::User::Balance.new(runner_context.call(:user))
|
97
86
|
end
|
98
87
|
end
|
99
88
|
end
|
@@ -1,36 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require '
|
5
|
-
require 'eac_ruby_utils/require_sub'
|
6
|
-
::EacRubyUtils.require_sub(__FILE__)
|
7
|
-
require 'avmtrf1/configs'
|
3
|
+
require 'eac_config/node'
|
4
|
+
require 'avmtrf1/core_ext'
|
8
5
|
require 'avmtrf1/forponto/user'
|
9
6
|
|
10
7
|
module Avmtrf1
|
11
8
|
module Tools
|
12
9
|
class Runner
|
13
|
-
class Forponto
|
14
|
-
|
15
|
-
include ::EacRubyUtils::Console::Speaker
|
10
|
+
class Forponto
|
11
|
+
require_sub __FILE__
|
16
12
|
|
17
13
|
DEFAULT_VALUES = {
|
18
14
|
url: 'http://pontoeletronico.trf1.jus.br/forponto/fptoweb.exe'
|
19
15
|
}.freeze
|
20
16
|
|
21
|
-
|
22
|
-
Operações para Forponto.
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
Options:
|
29
|
-
-h --help Show this screen.
|
30
|
-
-u --url=<url> URL inicial.
|
31
|
-
-m --matricula=<matricula> Matrícula.
|
32
|
-
-c --codigo=<codigo> Código.
|
33
|
-
DOCOPT
|
17
|
+
runner_with :help, :subcommands do
|
18
|
+
desc 'Operações para Forponto.'
|
19
|
+
arg_opt '-u', '--url', 'URL inicial.'
|
20
|
+
arg_opt '-m', '--matricula', 'Matrícula.'
|
21
|
+
arg_opt '-c', '--codigo', 'Código.'
|
22
|
+
subcommands
|
23
|
+
end
|
34
24
|
|
35
25
|
def run
|
36
26
|
start_banner
|
@@ -47,7 +37,7 @@ module Avmtrf1
|
|
47
37
|
end
|
48
38
|
|
49
39
|
def value_by_option(name)
|
50
|
-
|
40
|
+
parsed.fetch(name)
|
51
41
|
end
|
52
42
|
|
53
43
|
def value_by_default(name)
|
@@ -55,7 +45,7 @@ module Avmtrf1
|
|
55
45
|
end
|
56
46
|
|
57
47
|
def value_by_entry(name, read_options)
|
58
|
-
::
|
48
|
+
::EacConfig::Node.context.current.entry("trf1.forponto.#{name}", read_options).value
|
59
49
|
end
|
60
50
|
|
61
51
|
def user_uncached
|
@@ -1,28 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/console/speaker'
|
5
|
-
require 'eac_ruby_utils/simple_cache'
|
3
|
+
require 'avmtrf1/core_ext'
|
6
4
|
require 'avmtrf1/git/cached_repository'
|
7
5
|
|
8
6
|
module Avmtrf1
|
9
7
|
module Tools
|
10
8
|
class Runner
|
11
9
|
class Git < ::Avm::Tools::Runner::Git
|
12
|
-
class IssuesCheck
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
Confronta situação das demandas no Git com a situação nos trackers.
|
18
|
-
|
19
|
-
Usage:
|
20
|
-
__PROGRAM__ [options] <git-url>
|
21
|
-
__PROGRAM__ -h | --help
|
22
|
-
|
23
|
-
Options:
|
24
|
-
-h --help Mostra esta ajuda.
|
25
|
-
DOCOPT
|
10
|
+
class IssuesCheck
|
11
|
+
runner_with :help do
|
12
|
+
desc 'Confronta situação das demandas no Git com a situação nos trackers.'
|
13
|
+
pos_arg :git_url
|
14
|
+
end
|
26
15
|
|
27
16
|
def run
|
28
17
|
infov 'Repository path', git_url
|
@@ -34,7 +23,7 @@ module Avmtrf1
|
|
34
23
|
private
|
35
24
|
|
36
25
|
def git_url
|
37
|
-
|
26
|
+
parsed.git_url
|
38
27
|
end
|
39
28
|
|
40
29
|
def git_uncached
|
@@ -1,35 +1,44 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'avmtrf1/core_ext'
|
4
4
|
require 'avmtrf1/git/push_large'
|
5
5
|
|
6
6
|
module Avmtrf1
|
7
7
|
module Tools
|
8
8
|
class Runner
|
9
9
|
class Git < ::Avm::Tools::Runner::Git
|
10
|
-
class PushLarge
|
11
|
-
|
12
|
-
|
13
|
-
(Que falham com "pack exceeds maximum allowed size").
|
10
|
+
class PushLarge
|
11
|
+
DEFAULT_REPO_PATH = '.'
|
12
|
+
DEFAULT_REMOTE = 'origin'
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
14
|
+
runner_with :help do
|
15
|
+
desc 'Realiza push de repositórios grandes (Que falham com "pack exceeds maximum' \
|
16
|
+
' allowed size")'
|
17
|
+
arg_opt '-C', '--repo-path', 'Caminho do repositório local' \
|
18
|
+
" [default: #{DEFAULT_REPO_PATH}]."
|
19
|
+
arg_opt '-r', '--remote', "Nome do remoto [default: #{DEFAULT_REMOTE}]."
|
20
|
+
pos_arg :source_ref
|
21
|
+
pos_arg :target_ref
|
22
|
+
end
|
24
23
|
|
25
24
|
def run
|
26
25
|
::Avmtrf1::Git::PushLarge.new(
|
27
|
-
::File.expand_path(
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
::File.expand_path(repo_path),
|
27
|
+
remote,
|
28
|
+
parsed.source_ref,
|
29
|
+
parsed.target_ref
|
31
30
|
).run
|
32
31
|
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def repo_path
|
36
|
+
parsed.repo_path || DEFAULT_REPO_PATH
|
37
|
+
end
|
38
|
+
|
39
|
+
def remote
|
40
|
+
parsed.remote || DEFAULT_REMOTE
|
41
|
+
end
|
33
42
|
end
|
34
43
|
end
|
35
44
|
end
|
@@ -1,15 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/tools/runner/git'
|
4
|
-
require '
|
5
|
-
require 'avmtrf1/tools/runner/git/issues_check'
|
6
|
-
require 'avmtrf1/tools/runner/git/push_large'
|
7
|
-
require 'avmtrf1/patches/avm/git/issue/complete'
|
4
|
+
require 'avmtrf1/core_ext'
|
8
5
|
|
9
6
|
module Avmtrf1
|
10
7
|
module Tools
|
11
8
|
class Runner
|
12
9
|
class Git < ::Avm::Tools::Runner::Git
|
10
|
+
require_sub __FILE__
|
13
11
|
end
|
14
12
|
end
|
15
13
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avmtrf1/node_js/docker_image'
|
4
|
+
require 'avmtrf1/docker/image_runner'
|
5
|
+
|
6
|
+
module Avmtrf1
|
7
|
+
module Tools
|
8
|
+
class Runner
|
9
|
+
class NodeJs
|
10
|
+
class Docker < ::Avmtrf1::Docker::ImageRunner
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/core_ext'
|
4
|
+
|
5
|
+
module Avmtrf1
|
6
|
+
module Tools
|
7
|
+
class Runner
|
8
|
+
class NodeJs
|
9
|
+
require_sub __FILE__
|
10
|
+
|
11
|
+
runner_with :help, :subcommands do
|
12
|
+
desc 'Utilidades para Node.js.'
|
13
|
+
subcommands
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,20 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/console/docopt_runner'
|
5
|
-
require 'eac_ruby_utils/console/speaker'
|
3
|
+
require 'avmtrf1/core_ext'
|
6
4
|
|
7
5
|
module Avmtrf1
|
8
6
|
module Tools
|
9
7
|
class Runner
|
10
|
-
class Oracle
|
11
|
-
class Query
|
12
|
-
include ::EacCli::DefaultRunner
|
13
|
-
|
8
|
+
class Oracle
|
9
|
+
class Query
|
14
10
|
DEFAULT_COLUMN_SEPARATOR = "\t"
|
15
11
|
DEFAULT_ROW_SEPARATOR = "\n"
|
16
12
|
|
17
|
-
|
13
|
+
runner_with :help do
|
18
14
|
desc 'Executa queries Oracle.'
|
19
15
|
arg_opt '-c', '--column-sep', 'Separator de colunas.'
|
20
16
|
bool_opt '-C', '--columns', 'Imprime o nome das colunas.'
|
@@ -32,7 +28,7 @@ module Avmtrf1
|
|
32
28
|
end
|
33
29
|
|
34
30
|
def print_header
|
35
|
-
return unless
|
31
|
+
return unless parsed.columns?
|
36
32
|
|
37
33
|
print_row(cursor.column_metadata.map(&:name))
|
38
34
|
end
|
@@ -46,7 +42,7 @@ module Avmtrf1
|
|
46
42
|
end
|
47
43
|
|
48
44
|
def print_footer
|
49
|
-
return unless
|
45
|
+
return unless parsed.count?
|
50
46
|
|
51
47
|
print_row(["Count: #{count}"])
|
52
48
|
end
|
@@ -54,11 +50,11 @@ module Avmtrf1
|
|
54
50
|
private
|
55
51
|
|
56
52
|
def column_separator_uncached
|
57
|
-
|
53
|
+
parsed.column_sep.if_present(DEFAULT_COLUMN_SEPARATOR)
|
58
54
|
end
|
59
55
|
|
60
56
|
def cursor_uncached
|
61
|
-
|
57
|
+
runner_context.call(:connection).query(parsed.sql)
|
62
58
|
end
|
63
59
|
|
64
60
|
def print_row(array)
|
@@ -66,7 +62,7 @@ module Avmtrf1
|
|
66
62
|
end
|
67
63
|
|
68
64
|
def row_separator_uncached
|
69
|
-
|
65
|
+
parsed.row_sep.if_present(DEFAULT_ROW_SEPARATOR)
|
70
66
|
end
|
71
67
|
end
|
72
68
|
end
|
@@ -1,32 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/console/speaker'
|
3
|
+
require 'avmtrf1/core_ext'
|
5
4
|
|
6
5
|
module Avmtrf1
|
7
6
|
module Tools
|
8
7
|
class Runner
|
9
|
-
class Oracle
|
10
|
-
class SourceGet
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
__PROGRAM__ [options] <name> <type>
|
16
|
-
__PROGRAM__ -h | --help
|
17
|
-
|
18
|
-
Options:
|
19
|
-
-h --help Show this screen
|
20
|
-
DOCOPT
|
8
|
+
class Oracle
|
9
|
+
class SourceGet
|
10
|
+
runner_with :help do
|
11
|
+
pos_arg :name
|
12
|
+
pos_arg :type
|
13
|
+
end
|
21
14
|
|
22
15
|
TABLE = 'all_source'
|
23
16
|
|
24
17
|
def name
|
25
|
-
|
18
|
+
parsed.name
|
26
19
|
end
|
27
20
|
|
28
21
|
def type
|
29
|
-
|
22
|
+
parsed.type
|
30
23
|
end
|
31
24
|
|
32
25
|
def run
|
@@ -34,13 +27,13 @@ module Avmtrf1
|
|
34
27
|
infov('Type', type)
|
35
28
|
infov('Found', found_count)
|
36
29
|
infov('Enconding', OCI8.encoding)
|
37
|
-
|
30
|
+
connection.query(sql(false)) do |row|
|
38
31
|
out(row['TEXT'].encode('UTF-8').to_s)
|
39
32
|
end
|
40
33
|
end
|
41
34
|
|
42
35
|
def found_count
|
43
|
-
|
36
|
+
connection.unique_value(sql(true)).to_i
|
44
37
|
end
|
45
38
|
|
46
39
|
def sql(count)
|
@@ -49,6 +42,12 @@ module Avmtrf1
|
|
49
42
|
selection += " and lower(type) = lower('#{type}')" if type.present?
|
50
43
|
"select #{projection} from #{TABLE} where #{selection} order by line"
|
51
44
|
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def connection
|
49
|
+
runner_context.call(:connection)
|
50
|
+
end
|
52
51
|
end
|
53
52
|
end
|
54
53
|
end
|
@@ -1,19 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/console/docopt_runner'
|
5
|
-
require 'eac_ruby_utils/console/speaker'
|
3
|
+
require 'avmtrf1/core_ext'
|
6
4
|
|
7
5
|
module Avmtrf1
|
8
6
|
module Tools
|
9
7
|
class Runner
|
10
|
-
class Oracle
|
11
|
-
class UserClear
|
12
|
-
include ::EacCli::DefaultRunner
|
13
|
-
|
8
|
+
class Oracle
|
9
|
+
class UserClear
|
14
10
|
SELECTED_TYPES = %w[FUNCTION PACKAGE PROCEDURE SEQUENCE TABLE VIEW].freeze
|
15
11
|
|
16
|
-
|
12
|
+
runner_with :confirmation, :help do
|
17
13
|
desc 'Remove todos os objetos (Tabelas, views, etc) de um usuário Oracle.'
|
18
14
|
bool_opt '-y', '--yes', 'Remove sem perguntar.'
|
19
15
|
bool_opt '-d', '--drop', 'Remove os objetos.'
|
@@ -39,8 +35,8 @@ module Avmtrf1
|
|
39
35
|
end
|
40
36
|
|
41
37
|
def drop_objects
|
42
|
-
return unless
|
43
|
-
return unless confirm?
|
38
|
+
return unless parsed.drop
|
39
|
+
return unless confirm?('Confirma a remoção?')
|
44
40
|
|
45
41
|
infom 'Removendo objetos...'
|
46
42
|
objects.each do |object|
|
@@ -49,12 +45,8 @@ module Avmtrf1
|
|
49
45
|
end
|
50
46
|
end
|
51
47
|
|
52
|
-
def confirm?
|
53
|
-
options.fetch('--yes') || request_input('Confirma a remoção?', bool: true)
|
54
|
-
end
|
55
|
-
|
56
48
|
def owner_uncached
|
57
|
-
|
49
|
+
runner_context.call(:connection).objects.first(name: parsed.owner_name, type: :user)
|
58
50
|
end
|
59
51
|
|
60
52
|
def objects_uncached
|
@@ -1,29 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avmtrf1/core_ext'
|
3
4
|
require 'avmtrf1/oracle/connection/base.rb'
|
4
5
|
require 'avmtrf1/oracle/connection/string_builder.rb'
|
5
|
-
require 'eac_ruby_utils/core_ext'
|
6
6
|
|
7
7
|
module Avmtrf1
|
8
8
|
module Tools
|
9
9
|
class Runner
|
10
|
-
class Oracle
|
10
|
+
class Oracle
|
11
11
|
require_sub __FILE__
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
-h --help Show this screen
|
21
|
-
-H --host=<host> Host Oracle (Ex.: 172.16.3.3)
|
22
|
-
-p --port=<port> Porta Oracle (Ex.: 1521) (Padrão: 1521).
|
23
|
-
-s --service-name=<service> Serviço Oracle (Ex.: trf1.trf1.gov.br)
|
24
|
-
-u --user=<user> Usuário Oracle
|
25
|
-
-w --password=<password> Senha Oracle
|
26
|
-
DOCOPT
|
12
|
+
runner_with :help, :subcommands do
|
13
|
+
arg_opt '-H', '--host', 'Host Oracle (Ex.: 172.16.3.3)'
|
14
|
+
arg_opt '-p', '--port', 'Porta Oracle (Ex.: 1521) (Padrão: 1521)'
|
15
|
+
arg_opt '-s', '--service-name', 'Serviço Oracle (Ex.: trf1.trf1.gov.br)'
|
16
|
+
arg_opt '-u', '--user', 'Usuário Oracle'
|
17
|
+
arg_opt '-w', '--password', 'Senha Oracle'
|
18
|
+
subcommands
|
19
|
+
end
|
27
20
|
|
28
21
|
def connection
|
29
22
|
@connection ||= ::Avmtrf1::Oracle::Connection::Base.new(connection_string)
|
@@ -31,11 +24,11 @@ module Avmtrf1
|
|
31
24
|
|
32
25
|
def connection_string
|
33
26
|
::Avmtrf1::Oracle::Connection::StringBuilder.new(
|
34
|
-
host:
|
35
|
-
port:
|
36
|
-
user:
|
37
|
-
password:
|
38
|
-
service_name:
|
27
|
+
host: parsed.host,
|
28
|
+
port: parsed.port,
|
29
|
+
user: parsed.user,
|
30
|
+
password: parsed.password,
|
31
|
+
service_name: parsed.service_name
|
39
32
|
).build
|
40
33
|
end
|
41
34
|
end
|
@@ -1,72 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/docker/registry'
|
4
3
|
require 'avmtrf1/php/docker_image'
|
4
|
+
require 'avmtrf1/docker/image_runner'
|
5
5
|
require 'eac_cli/core_ext'
|
6
|
+
require 'eac_docker/registry'
|
6
7
|
|
7
8
|
module Avmtrf1
|
8
9
|
module Tools
|
9
10
|
class Runner
|
10
11
|
class Php
|
11
|
-
class Docker
|
12
|
-
runner_with :help do
|
13
|
-
bool_opt '-h', '--help', 'Mostra esta ajuda.'
|
14
|
-
bool_opt '-d', '--default', 'Adiciona as versões padrão.'
|
15
|
-
arg_opt '-n', '--registry-name', 'Nome do registro.'
|
16
|
-
bool_opt '-p', '--push', 'Envia a imagem.'
|
17
|
-
bool_opt '-S', '--no-snapshot', 'Não adiciona "-snapshot" no nome da imagem.'
|
18
|
-
bool_opt '-V', '--no-version', 'Não adiciona a versão do gerador no nome da imagem.'
|
19
|
-
pos_arg :version, repeat: true, optional: true
|
20
|
-
end
|
21
|
-
|
22
|
-
def run
|
23
|
-
infov 'Versions to build', versions_to_s
|
24
|
-
versions.each do |version|
|
25
|
-
process_version(version)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def default_versions
|
30
|
-
::Avmtrf1.configs.read_entry('php.default_versions').split(',').map(&:strip)
|
31
|
-
.reject(&:blank?)
|
32
|
-
end
|
33
|
-
|
34
|
-
def versions_to_s
|
35
|
-
if versions.any?
|
36
|
-
versions.join(', ')
|
37
|
-
else
|
38
|
-
'-- NONE --'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def versions
|
43
|
-
(
|
44
|
-
parsed.version +
|
45
|
-
(parsed.default? ? default_versions : [])
|
46
|
-
).uniq.sort
|
47
|
-
end
|
48
|
-
|
49
|
-
def process_version(version)
|
50
|
-
image = build_image(version)
|
51
|
-
infom "Building Docker image \"#{image.tag}\""
|
52
|
-
image.build
|
53
|
-
image.push if parsed.push?
|
54
|
-
end
|
55
|
-
|
56
|
-
def registry_name
|
57
|
-
parsed.registry_name || ::Avmtrf1.configs.read_entry('docker.registry.name')
|
58
|
-
end
|
59
|
-
|
60
|
-
def registry_uncached
|
61
|
-
::Avm::Docker::Registry.new(registry_name)
|
62
|
-
end
|
63
|
-
|
64
|
-
def build_image(php_version)
|
65
|
-
r = ::Avmtrf1::Php::DockerImage.new(registry, php_version)
|
66
|
-
r.send('version=', !parsed.no_version?)
|
67
|
-
r.snapshot = !parsed.no_snapshot?
|
68
|
-
r
|
69
|
-
end
|
12
|
+
class Docker < ::Avmtrf1::Docker::ImageRunner
|
70
13
|
end
|
71
14
|
end
|
72
15
|
end
|