avmtrf1-tools 0.39.2 → 0.39.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f18fafef35d11fbe741daa7a8947becf6740c513250ffcc40df6c107429d22cc
4
- data.tar.gz: 5f561f1f0414b3c7ce8bea5ea7e70aee0c2f637ff9badb670f977ed9b1405932
3
+ metadata.gz: c4e87303045206c85cc7dceca6eae42524d5fc999445d3c70da7aaa25264edd6
4
+ data.tar.gz: 48be5540c28b183937a35de6e520be9c527fb01324467d9fc65628788da44d8c
5
5
  SHA512:
6
- metadata.gz: 14726142418dea3e9388c0060be2673b83f366c0c0f9436c09cb19be46a9313b204e83bfdc8aa832696628ef06e0b50cbf5c971cd4111c17e67553696ff93cd9
7
- data.tar.gz: 176d11774e1a5e0012d040c4ee4c553d42c92cb3dd9c5a5475bcfa68620d50b2adf543323fc36455b595c29be5432cde86c4dcf5e97728e72134aecdc19cc4b8
6
+ metadata.gz: 24c987f0759a6f50da0732e8b5c2f9427c65fece5d01cadae7f5b773cb07af6f594f488a43aee3c5e632ffcd6e7126d8f4a8f83f5f546dd57f9ebec7b8815e50
7
+ data.tar.gz: 333344fa2141dab8c1bd1515398cf603895936f90d93a67b55e10cc694b393f1e8946a8e1f8434d63f81cd2cb03a97b001be371857c91f4fb78ae936a42a1465
data/Gemfile CHANGED
@@ -9,3 +9,6 @@ group :oracle do
9
9
  end
10
10
 
11
11
  gem 'httpclient', git: 'https://github.com/livelink/httpclient.git'
12
+
13
+ local_gemfile = ::File.join(::File.dirname(__FILE__), 'Gemfile.local')
14
+ eval_gemfile local_gemfile if ::File.exist?(local_gemfile)
@@ -15,6 +15,13 @@ module Avmtrf1
15
15
  --with-xpm-dir --with-freetype-dir].freeze
16
16
  PLATFORM_STEREOTYPE_TAG = 'php'
17
17
 
18
+ class << self
19
+ # @return [Gem::Version]
20
+ def php_version
21
+ const_get('PHP_VERSION')
22
+ end
23
+ end
24
+
18
25
  def platform_stereotype_tag
19
26
  PLATFORM_STEREOTYPE_TAG
20
27
  end
@@ -3,6 +3,7 @@
3
3
  require 'avmtrf1/php/docker_images/v5'
4
4
  require 'avmtrf1/php/docker_images/v7'
5
5
  require 'avmtrf1/php/docker_images/v7_v4'
6
+ require 'avmtrf1/php/docker_images/v8'
6
7
  require 'eac_ruby_utils/core_ext'
7
8
  require 'rubygems'
8
9
 
@@ -10,21 +11,25 @@ module Avmtrf1
10
11
  module Php
11
12
  module DockerImages
12
13
  class Factory
13
- V7 = ::Gem::Version.new('7')
14
- V7V4 = ::Gem::Version.new('7.4')
14
+ VERSIONS = [
15
+ ::Avmtrf1::Php::DockerImages::V8,
16
+ ::Avmtrf1::Php::DockerImages::V7V4,
17
+ ::Avmtrf1::Php::DockerImages::V7,
18
+ ::Avmtrf1::Php::DockerImages::V5
19
+ ].freeze
15
20
 
16
21
  common_constructor :platform_version do
17
22
  self.platform_version = ::Gem::Version.new(platform_version)
18
23
  end
19
24
 
20
25
  def result
21
- if platform_version < V7
22
- ::Avmtrf1::Php::DockerImages::V5
23
- elsif platform_version >= V7V4
24
- ::Avmtrf1::Php::DockerImages::V7V4
25
- else
26
- ::Avmtrf1::Php::DockerImages::V7
26
+ versions = VERSIONS.dup
27
+ lesser_version = versions.pop
28
+ versions.each do |version|
29
+ return version if platform_version >= version.php_version
27
30
  end
31
+
32
+ lesser_version
28
33
  end
29
34
  end
30
35
  end
@@ -11,7 +11,8 @@ module Avmtrf1
11
11
  RUN pecl install mcrypt
12
12
  RUN echo extension=mcrypt.so > "$PHP_INI_DIR/conf.d/mcrypt.ini"
13
13
  CODE
14
- XDEBUG_PECL_PACKAGE = 'xdebug'
14
+ PHP_VERSION = ::Gem::Version.new('7')
15
+ XDEBUG_PECL_PACKAGE = 'xdebug-3.1.6'
15
16
 
16
17
  def mcrypt_install
17
18
  MCRYPT_INSTALL
@@ -11,6 +11,7 @@ module Avmtrf1
11
11
  m[1]
12
12
  end
13
13
  GD_OPTION_REJECT = %w[--with-gd --with-png --with-zlib].freeze
14
+ PHP_VERSION = ::Gem::Version.new('7.4')
14
15
 
15
16
  # Referência: https://github.com/docker-library/php/issues/912
16
17
  def gd_options
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avmtrf1/php/docker_images/v7_v4'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avmtrf1
7
+ module Php
8
+ module DockerImages
9
+ class V8 < ::Avmtrf1::Php::DockerImages::V7V4
10
+ PHP_VERSION = ::Gem::Version.new('8')
11
+ XDEBUG_PECL_PACKAGE = 'xdebug'
12
+
13
+ def xdebug_pecl_package
14
+ XDEBUG_PECL_PACKAGE
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avmtrf1
4
4
  module Tools
5
- VERSION = '0.39.2'
5
+ VERSION = '0.39.3'
6
6
  end
7
7
  end
@@ -100,7 +100,7 @@ RUN curl -sS https://getcomposer.org/installer | \
100
100
  # Inicializador
101
101
  RUN mkdir '/aux'
102
102
  RUN mkdir '/aux/eac-bash-lib'
103
- RUN wget -qO- https://github.com/esquilo-azul/eac-bash-lib/archive/v0.6.1.tar.gz \
103
+ RUN wget -qO- https://codeload.github.com/esquilo-azul/eac-bash-lib/tar.gz/refs/tags/v0.17.1 \
104
104
  | tar -xzf - --strip-components 1 -C '/aux/eac-bash-lib'
105
105
  ADD aux '/aux'
106
106
  CMD '/aux/start.sh'
@@ -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
+ source "$AUX_ROOT/apache_user.sh"
16
+ infom "Executando \"app_user_run $@\"..."
17
+ app_user_run "$@"
@@ -40,7 +40,7 @@ function artisan_migrate() {
40
40
  function artisan_migrate_with_result() {
41
41
  set +e
42
42
  infom "Executando \"php artisan migrate\" em \"$1\"..."
43
- (cd "$1"; php artisan migrate --no-interaction --force 2>&1)
43
+ APP_USER_RUN_DIR="$1" app_user_run php artisan migrate --no-interaction --force 2>&1
44
44
  LAST_ARTISAN_MIGRATE_RESULT=$?
45
45
  set -e
46
46
  }
@@ -53,6 +53,6 @@ infom "Executando \"artisan migrate\" nos diretórios de \"$LARAVEL_PATH\"..."
53
53
  IFSBAK="$IFS"
54
54
  IFS=:
55
55
  for LARAVEL_DIR in $LARAVEL_PATH; do
56
- run_laravel "$(join_paths "$LARAVEL_DIR" "$APP_ROOT")"
56
+ run_laravel "$(path_expand "$LARAVEL_DIR" "$APP_ROOT")"
57
57
  done
58
58
  IFS="$IFSBAK"
@@ -3,6 +3,13 @@ set -e
3
3
 
4
4
  source "$AUX_ROOT/eac-bash-lib/init.sh"
5
5
 
6
+ function app_user_run() {
7
+ if var_blank_r 'APP_USER_RUN_DIR'; then
8
+ APP_USER_RUN_DIR="$APP_ROOT"
9
+ fi
10
+ (cd "$APP_USER_RUN_DIR" ; su "$(id -nu "$APP_USER_ID")" --command "$(shell_join "$@")" )
11
+ }
12
+
6
13
  function bool_set() {
7
14
  VARIABLE_NAME="$1"
8
15
  DEFAULT_VALUE="$2"
@@ -14,17 +21,6 @@ function bool_set() {
14
21
  export $VARIABLE_NAME="$(bool_s "$RESULT")"
15
22
  }
16
23
 
17
- function join_paths() {
18
- PATH_ARG="$1"
19
- BASE_ARG="$2"
20
-
21
- if [[ "$PATH_ARG" == '/'* ]]; then
22
- printf -- "%s\n" "$PATH_ARG"
23
- else
24
- printf -- "%s/%s\n" "$BASE_ARG" "$PATH_ARG"
25
- fi
26
- }
27
-
28
24
  function path_set() {
29
25
  VARIABLE_NAME="$1"
30
26
  BASE_PATH="$2"
@@ -32,7 +28,7 @@ function path_set() {
32
28
 
33
29
  RESULT="$DEFAULT_VALUE"
34
30
  if var_present_r "$VARIABLE_NAME"; then
35
- RESULT="$(join_paths "${!VARIABLE_NAME}" "$BASE_PATH")"
31
+ RESULT="$(path_expand "${!VARIABLE_NAME}" "$BASE_PATH")"
36
32
  fi
37
33
  if [ ! -d "$RESULT" ]; then
38
34
  fatal_error "Caminho \"$RESULT\" (\$$VARIABLE_NAME) não existe ou não é um diretório"
@@ -40,6 +36,20 @@ function path_set() {
40
36
  export $VARIABLE_NAME="$RESULT"
41
37
  }
42
38
 
39
+ function shell_join() {
40
+ RESULT=''
41
+ FIRST=true
42
+ for ARG in "$@"; do
43
+ if bool_r "$FIRST"; then
44
+ FIRST=false
45
+ else
46
+ outout ' '
47
+ fi
48
+ printf '%q' "$ARG"
49
+ done
50
+ outout "\n"
51
+ }
52
+
43
53
  function text_set() {
44
54
  VARIABLE_NAME="$1"
45
55
  DEFAULT_VALUE="$2"
@@ -15,17 +15,17 @@ source "$DIR/init.sh"
15
15
  function run_composer() {
16
16
  COMPOSER_DIR="$1"
17
17
  infom "Executando \"composer install\" para \"$COMPOSER_DIR\"..."
18
- COMPOSER_FILE="$(join_paths 'composer.json' "$COMPOSER_DIR")"
18
+ COMPOSER_FILE="$(path_expand 'composer.json' "$COMPOSER_DIR")"
19
19
  if [[ ! -f "$COMPOSER_FILE" ]]; then
20
20
  fatal_error "Arquivo \"$COMPOSER_FILE\" (\$COMPOSER_PATH) não encontrado"
21
21
  fi
22
- su "$(id -nu "$APP_USER_ID")" -c "composer install '--working-dir=$COMPOSER_DIR'"
22
+ app_user_run composer install "--working-dir=$COMPOSER_DIR"
23
23
  }
24
24
 
25
25
  infom "Executando \"composer install\" nos diretórios de \"$COMPOSER_PATH\"..."
26
26
  IFSBAK="$IFS"
27
27
  IFS=:
28
28
  for COMPOSER_DIR in $COMPOSER_PATH; do
29
- run_composer "$(join_paths "$COMPOSER_DIR" "$APP_ROOT")"
29
+ run_composer "$(path_expand "$COMPOSER_DIR" "$APP_ROOT")"
30
30
  done
31
31
  IFS="$IFSBAK"
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.39.2
4
+ version: 0.39.3
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: 2022-10-11 00:00:00.000000000 Z
11
+ date: 2022-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-selenium
@@ -16,54 +16,48 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.4'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.4.2
19
+ version: '0.5'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.4'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.4.2
26
+ version: '0.5'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: avm-eac_webapp_base0
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '0.9'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 0.9.2
33
+ version: '0.13'
43
34
  type: :runtime
44
35
  prerelease: false
45
36
  version_requirements: !ruby/object:Gem::Requirement
46
37
  requirements:
47
38
  - - "~>"
48
39
  - !ruby/object:Gem::Version
49
- version: '0.9'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 0.9.2
40
+ version: '0.13'
53
41
  - !ruby/object:Gem::Dependency
54
42
  name: avm-tools
55
43
  requirement: !ruby/object:Gem::Requirement
56
44
  requirements:
57
45
  - - "~>"
58
46
  - !ruby/object:Gem::Version
59
- version: '0.141'
47
+ version: '0.142'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 0.142.8
60
51
  type: :runtime
61
52
  prerelease: false
62
53
  version_requirements: !ruby/object:Gem::Requirement
63
54
  requirements:
64
55
  - - "~>"
65
56
  - !ruby/object:Gem::Version
66
- version: '0.141'
57
+ version: '0.142'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 0.142.8
67
61
  - !ruby/object:Gem::Dependency
68
62
  name: eac_rest
69
63
  requirement: !ruby/object:Gem::Requirement
@@ -107,7 +101,7 @@ dependencies:
107
101
  version: '1.13'
108
102
  - - ">="
109
103
  - !ruby/object:Gem::Version
110
- version: 1.13.8
104
+ version: 1.13.10
111
105
  type: :runtime
112
106
  prerelease: false
113
107
  version_requirements: !ruby/object:Gem::Requirement
@@ -117,7 +111,7 @@ dependencies:
117
111
  version: '1.13'
118
112
  - - ">="
119
113
  - !ruby/object:Gem::Version
120
- version: 1.13.8
114
+ version: 1.13.10
121
115
  - !ruby/object:Gem::Dependency
122
116
  name: recursive-open-struct
123
117
  requirement: !ruby/object:Gem::Requirement
@@ -295,6 +289,7 @@ files:
295
289
  - lib/avmtrf1/php/docker_images/v5.rb
296
290
  - lib/avmtrf1/php/docker_images/v7.rb
297
291
  - lib/avmtrf1/php/docker_images/v7_v4.rb
292
+ - lib/avmtrf1/php/docker_images/v8.rb
298
293
  - lib/avmtrf1/red.rb
299
294
  - lib/avmtrf1/red/client.rb
300
295
  - lib/avmtrf1/red/client/authorization.xml.erb
@@ -366,6 +361,7 @@ files:
366
361
  - template/avmtrf1/php/docker_images/base/Dockerfile.template
367
362
  - template/avmtrf1/php/docker_images/base/aux/apache_foreground.sh
368
363
  - template/avmtrf1/php/docker_images/base/aux/apache_user.sh
364
+ - template/avmtrf1/php/docker_images/base/aux/app_user_run.sh
369
365
  - template/avmtrf1/php/docker_images/base/aux/config_banner.sh
370
366
  - template/avmtrf1/php/docker_images/base/aux/init.sh
371
367
  - template/avmtrf1/php/docker_images/base/aux/laravel.sh