avmtrf1-tools 0.33.3 → 0.37.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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avmtrf1/active_directory/user.rb +3 -3
  3. data/lib/avmtrf1/default_jira.rb +3 -2
  4. data/lib/avmtrf1/docker/image.rb +12 -0
  5. data/lib/avmtrf1/docker/image_runner.rb +83 -0
  6. data/lib/avmtrf1/forponto/user/month.rb +2 -3
  7. data/lib/avmtrf1/git/gitlab.rb +11 -0
  8. data/lib/avmtrf1/git/push_large.rb +2 -2
  9. data/lib/avmtrf1/gitlab/commit.rb +37 -0
  10. data/lib/avmtrf1/gitlab/repository.rb +41 -0
  11. data/lib/avmtrf1/node_js/docker_image.rb +10 -0
  12. data/lib/avmtrf1/node_js.rb +9 -0
  13. data/lib/avmtrf1/php/docker_image.rb +2 -19
  14. data/lib/avmtrf1/tools/runner/app_src.rb +14 -0
  15. data/lib/avmtrf1/tools/runner/forponto.rb +3 -2
  16. data/lib/avmtrf1/tools/runner/git/gitlab/commit_link.rb +81 -0
  17. data/lib/avmtrf1/tools/runner/git/gitlab.rb +20 -0
  18. data/lib/avmtrf1/tools/runner/node_js/docker.rb +15 -0
  19. data/lib/avmtrf1/tools/runner/node_js.rb +18 -0
  20. data/lib/avmtrf1/tools/runner/php/docker.rb +2 -59
  21. data/lib/avmtrf1/tools/runner.rb +3 -5
  22. data/lib/avmtrf1/tools/version.rb +1 -1
  23. data/template/avmtrf1/node_js/docker_image/Dockerfile.template +11 -0
  24. data/template/avmtrf1/node_js/docker_image/auxiliary/config_banner.sh +15 -0
  25. data/template/avmtrf1/node_js/docker_image/auxiliary/init.sh +17 -0
  26. data/template/avmtrf1/node_js/docker_image/auxiliary/lib.sh +30 -0
  27. data/template/avmtrf1/node_js/docker_image/auxiliary/ng_serve.sh +16 -0
  28. data/template/avmtrf1/node_js/docker_image/auxiliary/npm_install.sh +21 -0
  29. data/template/avmtrf1/node_js/docker_image/auxiliary/start.sh +17 -0
  30. data/template/avmtrf1/php/docker_image/Dockerfile.template +1 -1
  31. metadata +38 -21
  32. data/lib/avmtrf1/fs_cache.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55b03fc11cc828e37128763a828a3821861c3e16f97fbde31974c167be47749b
4
- data.tar.gz: 8bddf62bd92b51245ceca1a5ae64ad26d80002e13e68c4a1ee3701ec4fa74bbf
3
+ metadata.gz: 31c309491959a0594c3df8dc41fc1289c23bf01a1b49098ab71ab088ee1902ae
4
+ data.tar.gz: 6e6e2234030d966e8bfc89e7d4d55b9012f59152dcc62694cde7a7ebdd8d8b5f
5
5
  SHA512:
6
- metadata.gz: 1c85df1801f0a65cd4a663b379a4f2a6ae026fa85cf18cab13239f0ac8bbfee5bca6c789c661b681238a16acaa72f51982e797b58e13f1622d082d8252b9e89e
7
- data.tar.gz: 564e6cc7069fb91ec8bcf3f5f6901a8e7baa13baad7f1102e12e09dd785af93d646e415dc5dac5f87dc49de38cc09f4bdc0dc089900804472dfaea8ff45c9866
6
+ metadata.gz: 74b0a854547a9cbab8d4f46114d8e5cce72a3a149c5d9028ee92c8e8ad2779aef249e1cdce545d0cab0d9a2990a14a5b17a99f71ce2a8cc39bc762f955bc8dfe
7
+ data.tar.gz: 2c924ccd64479d9b4e6bd6e8a47b2e5a7d30beefac7bd1763731cf6b48598325f088614c0b510312e8b3b96b92493e3b3ae8d947dbe8fd9c7292c0db008d4393
@@ -6,9 +6,9 @@ module Avmtrf1
6
6
  class << self
7
7
  def by_configs(path_prefix)
8
8
  new(
9
- ::Avm::Apps::Config.current.entry("#{path_prefix}.domain").value,
10
- ::Avm::Apps::Config.current.entry("#{path_prefix}.username").value,
11
- ::Avm::Apps::Config.current.entry("#{path_prefix}.password", noecho: true).value
9
+ ::EacConfig::Node.context.current.entry("#{path_prefix}.domain").value,
10
+ ::EacConfig::Node.context.current.entry("#{path_prefix}.username").value,
11
+ ::EacConfig::Node.context.current.entry("#{path_prefix}.password").secret_value
12
12
  )
13
13
  end
14
14
  end
@@ -9,8 +9,9 @@ module Avmtrf1
9
9
  def default_jira
10
10
  @default_jira ||= ::Avmtrf1::Jira::Instance.new(
11
11
  'https://jira.engesoftware.com.br',
12
- ::Avm::Apps::Config.current.entry("#{DEFAULT_JIRA_PATH_PREFIX}.username").value,
13
- ::Avm::Apps::Config.current.entry("#{DEFAULT_JIRA_PATH_PREFIX}.password", noecho: true).value
12
+ ::EacConfig::Node.context.current.entry("#{DEFAULT_JIRA_PATH_PREFIX}.username").value,
13
+ ::EacConfig::Node.context.current
14
+ .entry("#{DEFAULT_JIRA_PATH_PREFIX}.password").secret_value
14
15
  )
15
16
  end
16
17
  end
@@ -7,6 +7,18 @@ require 'avmtrf1/template'
7
7
  module Avmtrf1
8
8
  module Docker
9
9
  class Image < ::Avm::Docker::Image
10
+ enable_simple_cache
11
+
12
+ common_constructor :registry, :plataform_version
13
+
14
+ def plataform_stereotype_tag
15
+ self.class.name.split('::')[-2].underscore.dasherize
16
+ end
17
+
18
+ def stereotype_tag
19
+ "#{plataform_stereotype_tag}-#{plataform_version}"
20
+ end
21
+
10
22
  def generator_version
11
23
  ::Avmtrf1::Tools::VERSION
12
24
  end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_config/node'
4
+ require 'eac_ruby_base0/core_ext'
5
+ require 'eac_docker/registry'
6
+
7
+ module Avmtrf1
8
+ module Docker
9
+ class ImageRunner
10
+ runner_with :help do
11
+ bool_opt '-h', '--help', 'Mostra esta ajuda.'
12
+ bool_opt '-d', '--default', 'Adiciona as versões padrão.'
13
+ arg_opt '-n', '--registry-name', 'Nome do registro.'
14
+ bool_opt '-p', '--push', 'Envia a imagem.'
15
+ bool_opt '-S', '--no-snapshot', 'Não adiciona "-snapshot" no nome da imagem.'
16
+ bool_opt '-V', '--no-version', 'Não adiciona a versão do gerador no nome da imagem.'
17
+ pos_arg :version, repeat: true, optional: true
18
+ end
19
+
20
+ def run
21
+ infov 'Versions to build', versions_to_s
22
+ versions.each do |version|
23
+ process_version(version)
24
+ end
25
+ end
26
+
27
+ def default_versions
28
+ ::EacConfig::Node.context.current.entry(default_versions_config_key).value.split(',')
29
+ .map(&:strip).reject(&:blank?)
30
+ end
31
+
32
+ def versions_to_s
33
+ if versions.any?
34
+ versions.join(', ')
35
+ else
36
+ '-- NONE --'
37
+ end
38
+ end
39
+
40
+ def versions
41
+ (
42
+ parsed.version +
43
+ (parsed.default? ? default_versions : [])
44
+ ).uniq.sort
45
+ end
46
+
47
+ def process_version(version)
48
+ image = build_image(version)
49
+ infom "Building Docker image \"#{image.tag}\""
50
+ image.build
51
+ image.push if parsed.push?
52
+ end
53
+
54
+ def registry_name
55
+ parsed.registry_name || ::EacConfig::Node.context.current.entry('docker.registry.name')
56
+ .value
57
+ end
58
+
59
+ def registry_uncached
60
+ ::EacDocker::Registry.new(registry_name)
61
+ end
62
+
63
+ def build_image(plataform_version)
64
+ r = docker_image_class.new(registry, plataform_version)
65
+ r.send('version=', !parsed.no_version?)
66
+ r.snapshot = !parsed.no_snapshot?
67
+ r
68
+ end
69
+
70
+ def default_versions_config_key
71
+ "#{plataform_name.underscore}.default_versions"
72
+ end
73
+
74
+ def docker_image_class
75
+ "Avmtrf1::#{plataform_name}::DockerImage".constantize
76
+ end
77
+
78
+ def plataform_name
79
+ self.class.name.split('::')[-2]
80
+ end
81
+ end
82
+ end
83
+ end
@@ -6,7 +6,6 @@ require 'eac_ruby_utils/yaml'
6
6
  require 'recursive-open-struct'
7
7
  require 'avmtrf1/forponto/parsers/espelho'
8
8
  require 'avmtrf1/forponto/session'
9
- require 'avmtrf1/fs_cache'
10
9
 
11
10
  module Avmtrf1
12
11
  module Forponto
@@ -87,7 +86,7 @@ module Avmtrf1
87
86
  end
88
87
 
89
88
  def recache?
90
- !data_cache.cached? || yesterday_uncached?
89
+ !data_cache.stored? || yesterday_uncached?
91
90
  end
92
91
 
93
92
  def yesterday_uncached?
@@ -115,7 +114,7 @@ module Avmtrf1
115
114
  end
116
115
 
117
116
  def cached_data
118
- raise 'There is no data cached' unless data_cache.cached?
117
+ raise 'There is no data cached' unless data_cache.stored?
119
118
 
120
119
  ::EacRubyUtils::Yaml.load(data_cache.read)
121
120
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avmtrf1/core_ext'
4
+
5
+ module Avmtrf1
6
+ module Git
7
+ module Gitlab
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -30,8 +30,8 @@ module Avmtrf1
30
30
  push_revisions
31
31
  end
32
32
 
33
- def fs_cache
34
- @fs_cache ||= ::Avmtrf1.fs_cache.child(::File.expand_path(git).parameterize)
33
+ def fs_cache_object_id
34
+ ::File.expand_path(git).parameterize
35
35
  end
36
36
 
37
37
  private
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avmtrf1
4
+ module Gitlab
5
+ class Commit
6
+ enable_speaker
7
+ enable_simple_cache
8
+ common_constructor :repository, :git, :source
9
+
10
+ delegate :id, to: :git_commit
11
+
12
+ def to_s
13
+ source
14
+ end
15
+
16
+ # @return [String]
17
+ def markdown_link(object_type = 'commit')
18
+ "[#{git_commit.abbreviated_commit_hash}|#{web_url(object_type)}]"
19
+ end
20
+
21
+ # @return [String]
22
+ def textile_link(object_type = 'commit')
23
+ "\"#{git_commit.abbreviated_commit_hash}\":#{web_url(object_type)}"
24
+ end
25
+
26
+ def web_url(object_type = 'commit')
27
+ "#{repository.web_url}/#{object_type}/#{git_commit.commit_hash}"
28
+ end
29
+
30
+ private
31
+
32
+ def git_commit_uncached
33
+ git.commit(git.rev_parse(source))
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avmtrf1/core_ext'
4
+
5
+ module Avmtrf1
6
+ module Gitlab
7
+ class Repository
8
+ class << self
9
+ # @param uri [String]
10
+ # @return [Avmtrf1::Gitlab::Address, nil]
11
+ def by_uri(uri)
12
+ by_git_uri(uri) || by_https_uri(uri)
13
+ end
14
+
15
+ # @param uri [String]
16
+ # @return [Avmtrf1::Gitlab::Address, nil]
17
+ def by_git_uri(uri)
18
+ /\Agit@(.+):(.+)\z/i.if_match(uri, false) do |m|
19
+ new(:git, m[1], m[2])
20
+ end
21
+ end
22
+
23
+ # @param uri [String]
24
+ # @return [Avmtrf1::Gitlab::Address, nil]
25
+ def by_https_uri(uri)
26
+ %r{\Ahttps?:\/\/([^\/]+)\/(.+)\z}i.if_match(uri, false) do |m|
27
+ new(:https, m[1], m[2])
28
+ end
29
+ end
30
+ end
31
+
32
+ common_constructor :protocol, :authority, :path do
33
+ self.path = '/' + path.to_s.gsub(/\.git\Z/, '').gsub(%r{\A/+}, '')
34
+ end
35
+
36
+ def web_url
37
+ "https://#{authority}#{path}"
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avmtrf1/docker/image'
4
+
5
+ module Avmtrf1
6
+ module NodeJs
7
+ class DockerImage < ::Avmtrf1::Docker::Image
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avmtrf1
6
+ module NodeJs
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -19,25 +19,8 @@ module Avmtrf1
19
19
  XDEBUG_PECL_PACKAGE_LESSER_7 = 'xdebug-2.5.5'
20
20
  XDEBUG_PECL_PACKAGE_GREATER_EQUAL = 'xdebug'
21
21
 
22
- enable_simple_cache
23
-
24
- attr_reader :php_version
25
-
26
- def initialize(registry, php_version)
27
- super(registry)
28
- @php_version = php_version
29
- end
30
-
31
- def stereotype_tag
32
- "php-#{php_version}"
33
- end
34
-
35
- def template_dir
36
- ::Avmtrf1.template('avmtrf1/php/docker_image')
37
- end
38
-
39
22
  def mcrypt_install
40
- if ::Gem::Version.new(php_version) >= ::Gem::Version.new('7.2')
23
+ if ::Gem::Version.new(plataform_version) >= ::Gem::Version.new('7.2')
41
24
  MCRYPT_INSTALL_GREATER_EQUAL_7_2
42
25
  else
43
26
  MCRYPT_INSTALL_LESSER_7_2
@@ -45,7 +28,7 @@ module Avmtrf1
45
28
  end
46
29
 
47
30
  def xdebug_pecl_package
48
- if ::Gem::Version.new(php_version) < ::Gem::Version.new('7')
31
+ if ::Gem::Version.new(plataform_version) < ::Gem::Version.new('7')
49
32
  XDEBUG_PECL_PACKAGE_LESSER_7
50
33
  else
51
34
  XDEBUG_PECL_PACKAGE_GREATER_EQUAL
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/tools/runner/app_src'
4
+ require 'avmtrf1/core_ext'
5
+
6
+ module Avmtrf1
7
+ module Tools
8
+ class Runner
9
+ class AppSrc < ::Avm::Tools::Runner::AppSrc
10
+ require_sub __FILE__
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/apps/config'
3
+ require 'eac_config/node'
4
4
  require 'avmtrf1/core_ext'
5
5
  require 'avmtrf1/forponto/user'
6
6
 
@@ -45,7 +45,8 @@ module Avmtrf1
45
45
  end
46
46
 
47
47
  def value_by_entry(name, read_options)
48
- ::Avm::Apps::Config.current.entry("trf1.forponto.#{name}", read_options).value
48
+ ::EacConfig::Node.context.current.entry("trf1.forponto.#{name}", read_options)
49
+ .send(read_options[:noecho] ? :secret_value : :value)
49
50
  end
50
51
 
51
52
  def user_uncached
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/tools/runner/git'
4
+ require 'avmtrf1/core_ext'
5
+ require 'avmtrf1/gitlab/commit'
6
+ require 'avmtrf1/gitlab/repository'
7
+
8
+ module Avmtrf1
9
+ module Tools
10
+ class Runner
11
+ class Git < ::Avm::Tools::Runner::Git
12
+ class Gitlab
13
+ class CommitLink
14
+ runner_with :help, :output do
15
+ desc 'Mostra o link de uma revisão no Gitlab do TRF1.'
16
+ bool_opt '-m', '--markdown', 'Formata URL como link Markdown.'
17
+ bool_opt '-t', '--tree', 'URL com "tree" no lugar de "commit".'
18
+ bool_opt '-T', '--textile', 'Formata URL como link Textile.'
19
+ pos_arg 'revisions', optional: true, repeat: true
20
+ end
21
+
22
+ def run
23
+ repository_banner
24
+ commits.each { |c| commit_banner(c) }
25
+ run_output
26
+ end
27
+
28
+ def separator
29
+ puts '-' * 40
30
+ end
31
+
32
+ def object_type
33
+ parsed.tree? ? 'tree' : 'commit'
34
+ end
35
+
36
+ private
37
+
38
+ def commits_uncached
39
+ parsed.revisions.if_present(['HEAD'])
40
+ .map { |source| ::Avmtrf1::Gitlab::Commit.new(repository, git_repo, source) }
41
+ end
42
+
43
+ def commit_banner(commit)
44
+ separator
45
+ infov 'Source', commit.source
46
+ infov 'Commit ID', commit.id
47
+ infov 'Web URL', commit.web_url
48
+ end
49
+
50
+ # @return [String]
51
+ def commit_output(commit)
52
+ return commit.textile_link(object_type) if parsed.textile?
53
+ return commit.markdown_link(object_type) if parsed.markdown?
54
+
55
+ commit.web_url(object_type)
56
+ end
57
+
58
+ def git_repo
59
+ runner_context.call(:git_repo)
60
+ end
61
+
62
+ def output_content
63
+ commits.map { |c| commit_output(c) + "\n" }.join
64
+ end
65
+
66
+ def repository_banner
67
+ separator
68
+ infov 'Repository', repository.path
69
+ end
70
+
71
+ def repository_uncached
72
+ git_repo.remotes.lazy
73
+ .map { |r| ::Avmtrf1::Gitlab::Repository.by_uri(r.url) }
74
+ .find(&:present?) || raise('Gitlab remote not found')
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/tools/runner/git'
4
+ require 'avmtrf1/core_ext'
5
+
6
+ module Avmtrf1
7
+ module Tools
8
+ class Runner
9
+ class Git < ::Avm::Tools::Runner::Git
10
+ class Gitlab
11
+ require_sub __FILE__
12
+ runner_with :help, :subcommands do
13
+ desc 'Utilidades para Gitlab.'
14
+ subcommands
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ 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,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avmtrf1/php/docker_image'
4
+ require 'avmtrf1/docker/image_runner'
4
5
  require 'eac_cli/core_ext'
5
6
  require 'eac_docker/registry'
6
7
 
@@ -8,65 +9,7 @@ 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
- ::Avm::Apps::Config.current.entry('php.default_versions').value.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 || ::Avm::Apps::Config.current.entry('docker.registry.name').value
58
- end
59
-
60
- def registry_uncached
61
- ::EacDocker::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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/apps/config'
3
+ require 'eac_config/node'
4
4
  require 'aranha/selenium/driver_factory/base'
5
5
  require 'avmtrf1/ruby/gems/not_found_error'
6
6
  require 'avmtrf1/tools/application'
@@ -23,10 +23,8 @@ module Avmtrf1
23
23
  end
24
24
 
25
25
  def run
26
- ::Avm::Apps::Config.context.on(application.build_config) do
27
- ::Aranha::Selenium::DriverFactory::Base.default_headless = parsed.headless?
28
- super
29
- end
26
+ ::Aranha::Selenium::DriverFactory::Base.default_headless = parsed.headless?
27
+ super
30
28
  rescue ::Avmtrf1::Ruby::Gems::NotFoundError => e
31
29
  on_gem_not_found(e.dependency)
32
30
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avmtrf1
4
4
  module Tools
5
- VERSION = '0.33.3'
5
+ VERSION = '0.37.0'
6
6
  end
7
7
  end
@@ -0,0 +1,11 @@
1
+ # base image
2
+ FROM node:%%PLATAFORM_VERSION%%
3
+
4
+ # Inicializador
5
+ RUN mkdir '/auxiliary'
6
+ RUN mkdir '/auxiliary/eac-bash-lib'
7
+ RUN wget -qO- https://github.com/esquilo-azul/eac-bash-lib/archive/449833c28d645e5925a4cc4bdb6a127eba80d38c.tar.gz \
8
+ | tar -xzf - --strip-components 1 -C '/auxiliary/eac-bash-lib'
9
+ ADD auxiliary '/auxiliary'
10
+ RUN chmod -R +x '/auxiliary'
11
+ CMD '/auxiliary/start.sh'
@@ -0,0 +1,15 @@
1
+ #!/bin/bash
2
+
3
+ set -u
4
+ set -e
5
+
6
+ SOURCE="${BASH_SOURCE[0]}"
7
+ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
8
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
9
+ SOURCE="$(readlink "$SOURCE")"
10
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
11
+ done
12
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
13
+ source "$DIR/init.sh"
14
+
15
+ infov 'Application root path ($APP_ROOT)' "$APP_ROOT"
@@ -0,0 +1,17 @@
1
+ set -u
2
+ set -e
3
+
4
+ SOURCE="${BASH_SOURCE[0]}"
5
+ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
6
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
7
+ SOURCE="$(readlink "$SOURCE")"
8
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
9
+ done
10
+ export AUX_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
11
+
12
+ source "$AUX_ROOT/lib.sh"
13
+
14
+ # Caminho raiz da aplicação
15
+ path_set 'APP_ROOT' '/' '/app'
16
+
17
+ export PATH="$APP_ROOT/node_modules/.bin:$PATH"
@@ -0,0 +1,30 @@
1
+ set -u
2
+ set -e
3
+
4
+ source "$AUX_ROOT/eac-bash-lib/init.sh"
5
+
6
+ function join_paths() {
7
+ PATH_ARG="$1"
8
+ BASE_ARG="$2"
9
+
10
+ if [[ "$PATH_ARG" == '/'* ]]; then
11
+ printf -- "%s\n" "$PATH_ARG"
12
+ else
13
+ printf -- "%s/%s\n" "$BASE_ARG" "$PATH_ARG"
14
+ fi
15
+ }
16
+
17
+ function path_set() {
18
+ VARIABLE_NAME="$1"
19
+ BASE_PATH="$2"
20
+ DEFAULT_VALUE="$3"
21
+
22
+ RESULT="$DEFAULT_VALUE"
23
+ if var_present_r "$VARIABLE_NAME"; then
24
+ RESULT="$(join_paths "${!VARIABLE_NAME}" "$BASE_PATH")"
25
+ fi
26
+ if [ ! -d "$RESULT" ]; then
27
+ fatal_error "Caminho \"$RESULT\" (\$$VARIABLE_NAME) não existe ou não é um diretório"
28
+ fi
29
+ export $VARIABLE_NAME="$RESULT"
30
+ }
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+
3
+ set -u
4
+ set -e
5
+
6
+ SOURCE="${BASH_SOURCE[0]}"
7
+ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
8
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
9
+ SOURCE="$(readlink "$SOURCE")"
10
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
11
+ done
12
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
13
+ source "$DIR/init.sh"
14
+
15
+ infom "Executando \"ng serve\"..."
16
+ (cd "$APP_ROOT"; ng serve --host 0.0.0.0 )
@@ -0,0 +1,21 @@
1
+ #!/bin/bash
2
+
3
+ set -u
4
+ set -e
5
+
6
+ SOURCE="${BASH_SOURCE[0]}"
7
+ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
8
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
9
+ SOURCE="$(readlink "$SOURCE")"
10
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
11
+ done
12
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
13
+ source "$DIR/init.sh"
14
+
15
+ function npm_install() {
16
+ (cd "$APP_ROOT"; npm install "$@")
17
+ }
18
+
19
+ infom "Executando \"npm install\"..."
20
+ npm_install --save-dev --unsafe-perm node-sass
21
+ npm_install
@@ -0,0 +1,17 @@
1
+ #!/bin/bash
2
+
3
+ set -u
4
+ set -e
5
+
6
+ SOURCE="${BASH_SOURCE[0]}"
7
+ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
8
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
9
+ SOURCE="$(readlink "$SOURCE")"
10
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
11
+ done
12
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
13
+ source "$DIR/init.sh"
14
+
15
+ "$AUX_ROOT/config_banner.sh"
16
+ "$AUX_ROOT/npm_install.sh"
17
+ "$AUX_ROOT/ng_serve.sh"
@@ -1,4 +1,4 @@
1
- FROM php:%%PHP_VERSION%%-apache
1
+ FROM php:%%PLATAFORM_VERSION%%-apache
2
2
 
3
3
  # Base ubuntu
4
4
  RUN apt-get -y update
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avmtrf1-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.3
4
+ version: 0.37.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-13 00:00:00.000000000 Z
11
+ date: 2022-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-selenium
@@ -16,34 +16,34 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
19
+ version: '0.2'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.1.2
22
+ version: 0.2.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '0.1'
29
+ version: '0.2'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.1.2
32
+ version: 0.2.2
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: avm-tools
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.104'
39
+ version: '0.114'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.104'
46
+ version: '0.114'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: inifile
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -62,16 +62,22 @@ dependencies:
62
62
  name: nokogiri
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '1.13'
65
68
  - - ">="
66
69
  - !ruby/object:Gem::Version
67
- version: '0'
70
+ version: 1.13.1
68
71
  type: :runtime
69
72
  prerelease: false
70
73
  version_requirements: !ruby/object:Gem::Requirement
71
74
  requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '1.13'
72
78
  - - ">="
73
79
  - !ruby/object:Gem::Version
74
- version: '0'
80
+ version: 1.13.1
75
81
  - !ruby/object:Gem::Dependency
76
82
  name: recursive-open-struct
77
83
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +87,7 @@ dependencies:
81
87
  version: '1.1'
82
88
  - - ">="
83
89
  - !ruby/object:Gem::Version
84
- version: 1.1.1
90
+ version: 1.1.3
85
91
  type: :runtime
86
92
  prerelease: false
87
93
  version_requirements: !ruby/object:Gem::Requirement
@@ -91,7 +97,7 @@ dependencies:
91
97
  version: '1.1'
92
98
  - - ">="
93
99
  - !ruby/object:Gem::Version
94
- version: 1.1.1
100
+ version: 1.1.3
95
101
  - !ruby/object:Gem::Dependency
96
102
  name: roo
97
103
  requirement: !ruby/object:Gem::Requirement
@@ -118,20 +124,14 @@ dependencies:
118
124
  requirements:
119
125
  - - "~>"
120
126
  - !ruby/object:Gem::Version
121
- version: '0.1'
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: 0.1.1
127
+ version: '0.5'
125
128
  type: :development
126
129
  prerelease: false
127
130
  version_requirements: !ruby/object:Gem::Requirement
128
131
  requirements:
129
132
  - - "~>"
130
133
  - !ruby/object:Gem::Version
131
- version: '0.1'
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- version: 0.1.1
134
+ version: '0.5'
135
135
  description:
136
136
  email:
137
137
  executables:
@@ -154,6 +154,7 @@ files:
154
154
  - lib/avmtrf1/default_redmine.rb
155
155
  - lib/avmtrf1/docker.rb
156
156
  - lib/avmtrf1/docker/image.rb
157
+ - lib/avmtrf1/docker/image_runner.rb
157
158
  - lib/avmtrf1/esosti.rb
158
159
  - lib/avmtrf1/esosti/entities.rb
159
160
  - lib/avmtrf1/esosti/entities/issue.rb
@@ -184,9 +185,9 @@ files:
184
185
  - lib/avmtrf1/forponto/user/balance.rb
185
186
  - lib/avmtrf1/forponto/user/day_registers.rb
186
187
  - lib/avmtrf1/forponto/user/month.rb
187
- - lib/avmtrf1/fs_cache.rb
188
188
  - lib/avmtrf1/git.rb
189
189
  - lib/avmtrf1/git/cached_repository.rb
190
+ - lib/avmtrf1/git/gitlab.rb
190
191
  - lib/avmtrf1/git/issue_on_repository.rb
191
192
  - lib/avmtrf1/git/push_large.rb
192
193
  - lib/avmtrf1/git/push_large/_utils.rb
@@ -201,6 +202,8 @@ files:
201
202
  - lib/avmtrf1/git/push_large/source_commit.rb
202
203
  - lib/avmtrf1/git/push_large/source_commit/push.rb
203
204
  - lib/avmtrf1/git/reference.rb
205
+ - lib/avmtrf1/gitlab/commit.rb
206
+ - lib/avmtrf1/gitlab/repository.rb
204
207
  - lib/avmtrf1/ini.rb
205
208
  - lib/avmtrf1/ini/profile.rb
206
209
  - lib/avmtrf1/inventario_sistemas.rb
@@ -223,6 +226,8 @@ files:
223
226
  - lib/avmtrf1/jira/entities.rb
224
227
  - lib/avmtrf1/jira/entities/issue.rb
225
228
  - lib/avmtrf1/jira/instance.rb
229
+ - lib/avmtrf1/node_js.rb
230
+ - lib/avmtrf1/node_js/docker_image.rb
226
231
  - lib/avmtrf1/openvpn/config/builder.rb
227
232
  - lib/avmtrf1/openvpn/config/parser.rb
228
233
  - lib/avmtrf1/openvpn/config/parser/builder.rb
@@ -280,6 +285,7 @@ files:
280
285
  - lib/avmtrf1/tools.rb
281
286
  - lib/avmtrf1/tools/application.rb
282
287
  - lib/avmtrf1/tools/runner.rb
288
+ - lib/avmtrf1/tools/runner/app_src.rb
283
289
  - lib/avmtrf1/tools/runner/check_point.rb
284
290
  - lib/avmtrf1/tools/runner/check_point/login.rb
285
291
  - lib/avmtrf1/tools/runner/esosti.rb
@@ -292,9 +298,13 @@ files:
292
298
  - lib/avmtrf1/tools/runner/forponto/resumos.rb
293
299
  - lib/avmtrf1/tools/runner/forponto/saldo.rb
294
300
  - lib/avmtrf1/tools/runner/git.rb
301
+ - lib/avmtrf1/tools/runner/git/gitlab.rb
302
+ - lib/avmtrf1/tools/runner/git/gitlab/commit_link.rb
295
303
  - lib/avmtrf1/tools/runner/git/issues_check.rb
296
304
  - lib/avmtrf1/tools/runner/git/push_large.rb
297
305
  - lib/avmtrf1/tools/runner/inventario_sistemas.rb
306
+ - lib/avmtrf1/tools/runner/node_js.rb
307
+ - lib/avmtrf1/tools/runner/node_js/docker.rb
298
308
  - lib/avmtrf1/tools/runner/openvpn.rb
299
309
  - lib/avmtrf1/tools/runner/oracle.rb
300
310
  - lib/avmtrf1/tools/runner/oracle/query.rb
@@ -308,6 +318,13 @@ files:
308
318
  - lib/avmtrf1/tools/version.rb
309
319
  - lib/avmtrf1/trf1_dspace_base0/deploy.rb
310
320
  - lib/avmtrf1/trf1_dspace_base0/instance.rb
321
+ - template/avmtrf1/node_js/docker_image/Dockerfile.template
322
+ - template/avmtrf1/node_js/docker_image/auxiliary/config_banner.sh
323
+ - template/avmtrf1/node_js/docker_image/auxiliary/init.sh
324
+ - template/avmtrf1/node_js/docker_image/auxiliary/lib.sh
325
+ - template/avmtrf1/node_js/docker_image/auxiliary/ng_serve.sh
326
+ - template/avmtrf1/node_js/docker_image/auxiliary/npm_install.sh
327
+ - template/avmtrf1/node_js/docker_image/auxiliary/start.sh
311
328
  - template/avmtrf1/php/docker_image/Dockerfile.template
312
329
  - template/avmtrf1/php/docker_image/aux/apache_foreground.sh
313
330
  - template/avmtrf1/php/docker_image/aux/apache_user.sh
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/filesystem_cache'
4
-
5
- module Avmtrf1
6
- class << self
7
- def fs_cache
8
- @fs_cache ||= ::EacRubyUtils::FilesystemCache.new(ENV['HOME'], '.cache', 'avmtrf1-tools')
9
- end
10
- end
11
- end