avmtrf1-tools 0.33.1 → 0.35.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 +1 -1
- 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/gitlab.rb +11 -0
- data/lib/avmtrf1/git/push_large.rb +2 -2
- data/lib/avmtrf1/gitlab/commit.rb +29 -0
- data/lib/avmtrf1/gitlab/repository.rb +41 -0
- data/lib/avmtrf1/node_js/docker_image.rb +10 -0
- data/lib/avmtrf1/node_js.rb +9 -0
- data/lib/avmtrf1/php/docker_image.rb +2 -19
- data/lib/avmtrf1/tools/runner/app_src.rb +14 -0
- 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 +14 -23
- data/lib/avmtrf1/tools/runner/git/gitlab/commit_link.rb +71 -0
- data/lib/avmtrf1/tools/runner/git/gitlab.rb +20 -0
- 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 +1 -3
- data/lib/avmtrf1/tools/runner/php/docker.rb +3 -60
- data/lib/avmtrf1/tools/runner.rb +3 -5
- 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 +41 -24
- data/lib/avmtrf1/fs_cache.rb +0 -11
@@ -1,27 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/patches/module/speaker'
|
5
|
-
require 'eac_ruby_utils/simple_cache'
|
3
|
+
require 'avmtrf1/core_ext'
|
6
4
|
|
7
5
|
module Avmtrf1
|
8
6
|
module Tools
|
9
7
|
class Runner
|
10
|
-
class Forponto
|
11
|
-
class Espelho
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
Usage:
|
19
|
-
__PROGRAM__ [options] <year> <month>
|
20
|
-
__PROGRAM__ -h | --help
|
21
|
-
|
22
|
-
Options:
|
23
|
-
-h --help Show this screen.
|
24
|
-
DOCOPT
|
8
|
+
class Forponto
|
9
|
+
class Espelho
|
10
|
+
runner_with :help do
|
11
|
+
desc 'Recupera e trata dados do Forponto.'
|
12
|
+
pos_arg :year
|
13
|
+
pos_arg :month
|
14
|
+
end
|
25
15
|
|
26
16
|
def run
|
27
17
|
infov 'Start date', user_month.start_date
|
@@ -36,15 +26,15 @@ module Avmtrf1
|
|
36
26
|
end
|
37
27
|
|
38
28
|
def user_month_uncached
|
39
|
-
|
29
|
+
runner_context.call(:user).month(year, month)
|
40
30
|
end
|
41
31
|
|
42
32
|
def year
|
43
|
-
|
33
|
+
parsed.year.to_i
|
44
34
|
end
|
45
35
|
|
46
36
|
def month
|
47
|
-
|
37
|
+
parsed.month.to_i
|
48
38
|
end
|
49
39
|
|
50
40
|
def date(day)
|
@@ -1,27 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avmtrf1/forponto/user/day_registers'
|
4
|
-
require '
|
5
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'avmtrf1/core_ext'
|
6
5
|
|
7
6
|
module Avmtrf1
|
8
7
|
module Tools
|
9
8
|
class Runner
|
10
|
-
class Forponto
|
11
|
-
class Marcacoes
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
DOC = <<~DOCOPT
|
16
|
-
Mostra marcações Forponto do dia.
|
17
|
-
|
18
|
-
Usage:
|
19
|
-
__PROGRAM__ [options]
|
20
|
-
__PROGRAM__ -h | --help
|
21
|
-
|
22
|
-
Options:
|
23
|
-
-h --help Show this screen.
|
24
|
-
DOCOPT
|
9
|
+
class Forponto
|
10
|
+
class Marcacoes
|
11
|
+
runner_with :help do
|
12
|
+
desc 'Mostra marcações Forponto do dia.'
|
13
|
+
end
|
25
14
|
|
26
15
|
def run
|
27
16
|
infov 'Date', day_registers.date
|
@@ -34,7 +23,7 @@ module Avmtrf1
|
|
34
23
|
private
|
35
24
|
|
36
25
|
def day_registers_uncached
|
37
|
-
::Avmtrf1::Forponto::User::DayRegisters.new(
|
26
|
+
::Avmtrf1::Forponto::User::DayRegisters.new(runner_context.call(:user))
|
38
27
|
end
|
39
28
|
end
|
40
29
|
end
|
@@ -1,27 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'eac_ruby_utils/patches/module/speaker'
|
5
|
-
require 'eac_ruby_utils/simple_cache'
|
3
|
+
require 'avmtrf1/core_ext'
|
6
4
|
|
7
5
|
module Avmtrf1
|
8
6
|
module Tools
|
9
7
|
class Runner
|
10
|
-
class Forponto
|
11
|
-
class Resumos
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
DOC = <<~DOCOPT
|
16
|
-
Mostra os resumos.
|
17
|
-
|
18
|
-
Usage:
|
19
|
-
__PROGRAM__ [options]
|
20
|
-
__PROGRAM__ -h | --help
|
21
|
-
|
22
|
-
Options:
|
23
|
-
-h --help Show this screen.
|
24
|
-
DOCOPT
|
8
|
+
class Forponto
|
9
|
+
class Resumos
|
10
|
+
runner_with :help do
|
11
|
+
desc 'Mostra os resumos.'
|
12
|
+
end
|
25
13
|
|
26
14
|
def run
|
27
15
|
sorted_months.each do |month|
|
@@ -32,7 +20,7 @@ module Avmtrf1
|
|
32
20
|
def head_month
|
33
21
|
today = ::Date.today
|
34
22
|
date = ::Date.civil(today.year, today.month, 1)
|
35
|
-
|
23
|
+
runner_context.call(:user).month(date.year, date.month)
|
36
24
|
end
|
37
25
|
|
38
26
|
def show_month(month)
|
@@ -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 'avm/apps/config'
|
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
|
-
enable_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,8 @@ 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)
|
49
|
+
.send(read_options[:noecho] ? :secret_value : :value)
|
59
50
|
end
|
60
51
|
|
61
52
|
def user_uncached
|
@@ -0,0 +1,71 @@
|
|
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 '-t', '--tree', 'URL com "tree" no lugar de "commit".'
|
17
|
+
pos_arg 'revisions', optional: true, repeat: true
|
18
|
+
end
|
19
|
+
|
20
|
+
def run
|
21
|
+
repository_banner
|
22
|
+
commits.each { |c| commit_banner(c) }
|
23
|
+
run_output
|
24
|
+
end
|
25
|
+
|
26
|
+
def separator
|
27
|
+
puts '-' * 40
|
28
|
+
end
|
29
|
+
|
30
|
+
def object_type
|
31
|
+
parsed.tree? ? 'tree' : 'commit'
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def commits_uncached
|
37
|
+
parsed.revisions.if_present(['HEAD'])
|
38
|
+
.map { |source| ::Avmtrf1::Gitlab::Commit.new(repository, git, source) }
|
39
|
+
end
|
40
|
+
|
41
|
+
def commit_banner(commit)
|
42
|
+
separator
|
43
|
+
infov 'Source', commit.source
|
44
|
+
infov 'Commit ID', commit.full_id
|
45
|
+
infov 'Web URL', commit.web_url
|
46
|
+
end
|
47
|
+
|
48
|
+
def git
|
49
|
+
runner_context.call(:git)
|
50
|
+
end
|
51
|
+
|
52
|
+
def output_content
|
53
|
+
commits.map { |c| c.web_url(object_type) + "\n" }.join
|
54
|
+
end
|
55
|
+
|
56
|
+
def repository_banner
|
57
|
+
separator
|
58
|
+
infov 'Repository', repository.path
|
59
|
+
end
|
60
|
+
|
61
|
+
def repository_uncached
|
62
|
+
git.git.remotes.lazy
|
63
|
+
.map { |r| ::Avmtrf1::Gitlab::Repository.by_uri(r.url) }
|
64
|
+
.find(&:present?) || raise('Gitlab remote not found')
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
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
|
@@ -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,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
|
-
::Avm::Apps::Config.current.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 || ::Avm::Apps::Config.current.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
|
data/lib/avmtrf1/tools/runner.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
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
|
-
::
|
27
|
-
|
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
|
@@ -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"
|