avmtrf1-tools 0.16.1 → 0.17.0

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: b56af4bc622de91fef0d034ec66ea80cf49a44009b8e2f6deb4c282a7f3bf879
4
- data.tar.gz: 28e07eb935f9bc94e23848af1bbe48c248cb09498cf01737167649276b25d0bb
3
+ metadata.gz: e6f038192b1fb152219c3143fdc4c5a92abdf0042ac18e1329585f51c8a768c9
4
+ data.tar.gz: db236fd54bc0181c7a18ac3a9fe71ab03c2e46738fb0821435edab82415255d7
5
5
  SHA512:
6
- metadata.gz: 2c1a24bbe46362303eb12f0bac48d98b15d54b45c6f799f3d9264ef224087359640e466741dcf083adbc01e93958002ec8b3fdf05b9533d3c5ee49792fe765d1
7
- data.tar.gz: 26c9d981c75c939ad49db436d67380e7c5c8ede65143cec50acb12fb6cdc1ba70a8b854baa95f450f1ee6525a844d0d1ce71b02d47ba13f0e492a109513451f2
6
+ metadata.gz: 5bd6d2e681f00a8fb7bc38bbedae75bf3d9e20388781acc74703c0fca4a4d0bf1674312f7812cc29a25b4cc094b07170dd68560cfdbd3b7dba667bbf7792d370
7
+ data.tar.gz: 1c8bf9a09e3913d5627a321edd444b2e236ad6b51e84ab00f70df087ca3701fd03aa221b63180b22d39eb6d5b41c75ee74bd579ad7b4e2fe34a004bf22b3deac
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'active_support/json' # To-to: declare in gem "aranha"
4
4
  require 'aranha/selenium/session'
5
- Dir["#{File.dirname(__FILE__)}/#{::File.basename(__FILE__, '.*')}/*.rb"].each do |path|
5
+ Dir["#{File.dirname(__FILE__)}/#{::File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
6
6
  require path
7
7
  end
8
8
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'action_base'
4
- Dir["#{File.dirname(__FILE__)}/#{::File.basename(__FILE__, '.*')}/*.rb"].each do |path|
4
+ Dir["#{File.dirname(__FILE__)}/#{::File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
5
5
  require path
6
6
  end
7
7
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Dir["#{File.dirname(__FILE__)}/#{::File.basename(__FILE__, '.*')}/*.rb"].each do |path|
3
+ Dir["#{File.dirname(__FILE__)}/#{::File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
4
4
  require path
5
5
  end
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Dir["#{File.dirname(__FILE__)}/#{::File.basename(__FILE__, '.*')}/*.rb"].each do |path|
3
+ Dir["#{File.dirname(__FILE__)}/#{::File.basename(__FILE__, '.*')}/*.rb"].sort.each do |path|
4
4
  require path
5
5
  end
6
6
 
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/console/docopt_runner'
4
+ require 'eac_ruby_utils/core_ext'
5
+ require 'avmtrf1/trf1_dspace_base0/instance'
6
+
7
+ module Avmtrf1
8
+ module Tools
9
+ class Runner < ::EacRubyUtils::Console::DocoptRunner
10
+ class Trf1DspaceBase0 < ::EacRubyUtils::Console::DocoptRunner
11
+ ::EacRubyUtils.require_sub(__FILE__)
12
+
13
+ enable_simple_cache
14
+
15
+ DOC = <<~DOCOPT
16
+ Utilities for Trf1DspaceBase0 instances.
17
+
18
+ Usage:
19
+ __PROGRAM__ [options] <instance_id> __SUBCOMMANDS__
20
+ __PROGRAM__ -h | --help
21
+
22
+ Options:
23
+ -h --help Show this screen.
24
+ DOCOPT
25
+
26
+ private
27
+
28
+ def instance_uncached
29
+ ::Avmtrf1::Trf1DspaceBase0::Instance.by_id(options['<instance_id>'])
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avmtrf1/trf1_dspace_base0/deploy'
4
+ require 'avm/stereotypes/eac_webapp_base0/runner/deploy'
5
+
6
+ module Avmtrf1
7
+ module Tools
8
+ class Runner < ::EacRubyUtils::Console::DocoptRunner
9
+ class Trf1DspaceBase0 < ::EacRubyUtils::Console::DocoptRunner
10
+ class Deploy < ::Avm::Stereotypes::EacWebappBase0::Runner::Deploy
11
+ def stereotype_module
12
+ ::Avmtrf1::Trf1DspaceBase0
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avmtrf1
4
4
  module Tools
5
- VERSION = '0.16.1'
5
+ VERSION = '0.17.0'
6
6
  end
7
7
  end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/stereotypes/eac_webapp_base0/deploy'
4
+ require 'avm/stereotypes/eac_webapp_base0/deploy/file_unit' # To be fixed in gem "avm-tools"
5
+
6
+ module Avmtrf1
7
+ module Trf1DspaceBase0
8
+ class Deploy < ::Avm::Stereotypes::EacWebappBase0::Deploy
9
+ set_callback :assert_instance_branch, :after do
10
+ mvn_package
11
+ ant_update
12
+ link_apps_to_tomcat
13
+ restart_tomcat
14
+ end
15
+
16
+ def mvn_package
17
+ infom 'Executando "mvn package"...'
18
+ command('mvn', '-Ddb.name=oracle', '-U', 'package').system!
19
+ end
20
+
21
+ def ant_update
22
+ infom 'Executando "ant update"...'
23
+ command('ant', 'update').chdir(
24
+ fs_path.join('dspace', 'target', 'dspace-installer')
25
+ ).system!
26
+ end
27
+
28
+ def link_apps_to_tomcat
29
+ { 'jspui' => 'dspace', 'solr' => 'solr', 'xmlui' => 'xmlui' }.each do |app, context|
30
+ link_app_to_tomcat(app, context)
31
+ end
32
+ end
33
+
34
+ def restart_tomcat
35
+ infom 'Parando Tomcat...'
36
+ %w[shutdown startup].each do |script|
37
+ infom "Executando Tomcat:\"#{script}\".."
38
+ command(tomcat_fs_path.join('bin', "#{script}.sh")).system!
39
+ end
40
+ infom 'Esperando 15 segundos pelo Tomcat...'
41
+ sleep(15.seconds)
42
+ end
43
+
44
+ private
45
+
46
+ def command(*args)
47
+ instance.host_env.command(*args).chdir(fs_path)
48
+ end
49
+
50
+ def fs_path
51
+ ::Pathname.new(instance.read_entry('fs_path'))
52
+ end
53
+
54
+ def install_fs_path
55
+ ::Pathname.new(instance.read_entry('install_fs_path'))
56
+ end
57
+
58
+ def tomcat_fs_path
59
+ ::Pathname.new(instance.read_entry('tomcat_fs_path'))
60
+ end
61
+
62
+ def link_app_to_tomcat(app, context)
63
+ infom "Ligando aplicação \"#{app}\" => \"#{context}\" ao tomcat..."
64
+ source_path = install_fs_path.join('webapps', app)
65
+ target_path = tomcat_fs_path.join('webapps', context)
66
+ command('rm', '-f', target_path).system!
67
+ command('ln', '-s', source_path, target_path).system!
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/base'
4
+
5
+ module Avmtrf1
6
+ module Trf1DspaceBase0
7
+ class Instance < ::Avm::Instances::Base
8
+ FILES_UNITS = {}.freeze
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,186 @@
1
+ # DSpace build.properties
2
+ # This file should be customised to suit your build environment.
3
+ # Note that not all configuration is handled here, only the most common
4
+ # properties that tend to differ between build environments.
5
+ # For adjusting global settings or more complex settings, edit the relevant config file.
6
+ #
7
+ # IMPORTANT: Do not remove or comment out settings in build.properties
8
+ # When you edit the "build.properties" file (or a custom *.properties file),
9
+ # take care not to remove or comment out any settings. Doing so, may cause
10
+ # your final "dspace.cfg" file to be misconfigured with regards to that
11
+ # particular setting. Instead, if you wish to remove/disable a particular
12
+ # setting, just clear out its value. For example, if you don't want to be
13
+ # notified of new user registrations, ensure the "mail.registration.notify"
14
+ # setting has no value, e.g. "mail.registration.notify="
15
+ #
16
+
17
+ ##########################
18
+ # SERVER CONFIGURATION ##
19
+ ##########################
20
+
21
+ # DSpace installation directory. This is the location where you want
22
+ # to install DSpace. NOTE: this value will be copied over to the
23
+ # "dspace.dir" setting in the final "dspace.cfg" file. It can be
24
+ # modified later on in your "dspace.cfg", if needed.
25
+ #dspace.install.dir=/dspace
26
+ dspace.install.dir=%%INSTALL_FS_PATH%%
27
+
28
+ # DSpace host name - should match base URL. Do not include port number
29
+ dspace.hostname = localhost
30
+
31
+ # DSpace base host URL. Include port number etc.
32
+ dspace.baseUrl = %%WEB.SCHEME%%://%%WEB.HOSTNAME%%:%%WEB.PORT%%
33
+
34
+ # The user interface you will be using for DSpace. Common usage is either xmlui or jspui
35
+ dspace.ui = jspui
36
+
37
+ # Full link your end users will use to access DSpace. In most cases, this will be the baseurl followed by
38
+ # the context path to the UI you are using.
39
+ #
40
+ # Alternatively, you can use a url redirect or deploy the web application under the servlet container root.
41
+ # In this case, make sure to remove the /${dspace.ui} from the dspace.url property.
42
+ dspace.url = ${dspace.baseUrl}/${dspace.ui}
43
+
44
+ # Name of the site
45
+ dspace.name = BDTRF1 - Biblioteca Digital do TRF1 da 1\u00aa Regi\u00e3o
46
+
47
+ # Solr server
48
+ solr.server=%%WEB.SCHEME%%://%%WEB.HOSTNAME%%:%%WEB.PORT%%/solr
49
+
50
+ # Default language for metadata values
51
+ default.language = pt_BR
52
+
53
+ ##########################
54
+ # DATABASE CONFIGURATION #
55
+ ##########################
56
+
57
+ # Uncomment the appropriate block below for your database.
58
+ # postgres
59
+ #db.driver=org.postgresql.Driver
60
+ #db.url=jdbc:postgresql://localhost:5432/dspace
61
+ #db.username=dspace
62
+ #db.password=dspace
63
+
64
+ # oracle
65
+ db.driver= oracle.jdbc.OracleDriver
66
+ #PRD
67
+ #db.url = jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = srvbdrac2-scan-trf1.trf1.gov.br)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME=dspace)))
68
+ #dsv
69
+ # URL for connecting to database
70
+ db.url = jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = %%DATABASE.HOSTNAME%%)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME=%%DATABASE.SERVICE_NAME%%)))
71
+
72
+
73
+ # Database username and password
74
+ db.username = %%DATABASE.USERNAME%%
75
+ db.password = %%DATABASE.PASSWORD%%
76
+
77
+ #db.url=jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.221.1.200)(PORT = 5500)) (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME=orcl)))
78
+ #db.url=jdbc:oracle:thin:@10.221.1.200:5500/orcl
79
+ #db.url=jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL=TCP)(HOST=10.221.1.141)(PORT=1521)))(CONNECT_DATA=(SID=xe)(SERVER=DEDICATED)))
80
+
81
+ #db.username=dspace
82
+ #db.password=dspace
83
+
84
+ # Schema name - if your database contains multiple schemas, you can avoid
85
+ # problems with retrieving the definitions of duplicate object names by
86
+ # specifying the schema name that is used for DSpace.
87
+ # ORACLE USAGE NOTE: In Oracle, schema is equivalent to "username". This means
88
+ # specifying a "db.schema" is often unnecessary (i.e. you can leave it blank),
89
+ # UNLESS your Oracle DB Account (in db.username) has access to multiple schemas.
90
+ db.schema =
91
+
92
+ # Maximum number of DB connections in pool
93
+ db.maxconnections = 30
94
+
95
+ # Maximum time to wait before giving up if all connections in pool are busy (milliseconds)
96
+ db.maxwait = 5000
97
+
98
+ # Maximum number of idle connections in pool (-1 = unlimited)
99
+ db.maxidle = -1
100
+
101
+ # Determine if prepared statement should be cached. (default is true)
102
+ db.statementpool = true
103
+
104
+ # Specify a name for the connection pool (useful if you have multiple applications sharing Tomcat's dbcp)
105
+ # If not specified, defaults to 'dspacepool'
106
+ db.poolname = dspacepool
107
+
108
+ #######################
109
+ # EMAIL CONFIGURATION #
110
+ #######################
111
+
112
+ # SMTP mail server
113
+ mail.server = smtp.example.com
114
+
115
+ # SMTP mail server authentication username and password (if required)
116
+ # mail.server.username = myusername
117
+ # mail.server.password = mypassword
118
+ mail.server.username=
119
+ mail.server.password=
120
+
121
+ # SMTP mail server alternate port (defaults to 25)
122
+ mail.server.port = 25
123
+
124
+ # From address for mail
125
+ mail.from.address = dspace-noreply@myu.edu
126
+
127
+ # Currently limited to one recipient!
128
+ mail.feedback.recipient = dspace-help@myu.edu
129
+
130
+ # General site administration (Webmaster) e-mail
131
+ mail.admin = serau@trf1.jus.br
132
+
133
+ # Recipient for server errors and alerts
134
+ #mail.alert.recipient = email-address-here
135
+ mail.alert.recipient=
136
+
137
+ # Recipient for new user registration emails
138
+ #mail.registration.notify = email-address-here
139
+ mail.registration.notify=
140
+
141
+
142
+ ########################
143
+ # HANDLE CONFIGURATION #
144
+ ########################
145
+
146
+ # Canonical Handle URL prefix
147
+ #
148
+ # By default, DSpace is configured to use http://hdl.handle.net/
149
+ # as the canonical URL prefix when generating dc.identifier.uri
150
+ # during submission, and in the 'identifier' displayed in JSPUI
151
+ # item record pages.
152
+ #
153
+ # If you do not subscribe to CNRI's handle service, you can change this
154
+ # to match the persistent URL service you use, or you can force DSpace
155
+ # to use your site's URL, eg.
156
+ #handle.canonical.prefix = ${dspace.url}/handle/
157
+ #
158
+ # Note that this will not alter dc.identifer.uri metadata for existing
159
+ # items (only for subsequent submissions), but it will alter the URL
160
+ # in JSPUI's 'identifier' message on item record pages for existing items.
161
+ #
162
+ # If omitted, the canonical URL prefix will be http://hdl.handle.net/
163
+ handle.canonical.prefix = http://www.trf1.jus.br/dspace/handle/
164
+
165
+ # CNRI Handle prefix
166
+ handle.prefix = 123
167
+
168
+ #######################
169
+ # PROXY CONFIGURATION #
170
+ #######################
171
+ # uncomment and specify both properties if proxy server required
172
+ # proxy server for external http requests - use regular hostname without port number
173
+ http.proxy.host =
174
+
175
+ # port number of proxy server
176
+ http.proxy.port =
177
+
178
+ #####################
179
+ # LOGLEVEL SETTINGS #
180
+ #####################
181
+ loglevel.other = INFO
182
+ # loglevel.other: Log level for other third-party tools/APIs used by DSpace
183
+ # Possible values (from most to least info): DEBUG, INFO, WARN, ERROR, FATAL
184
+ loglevel.dspace = INFO
185
+ # loglevel.dspace: Log level for all DSpace-specific code (org.dspace.*)
186
+ # Possible values (from most to least info): DEBUG, INFO, WARN, ERROR, FATAL
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.16.1
4
+ version: 0.17.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: 2020-02-05 00:00:00.000000000 Z
11
+ date: 2020-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -188,28 +188,28 @@ dependencies:
188
188
  requirements:
189
189
  - - "~>"
190
190
  - !ruby/object:Gem::Version
191
- version: 0.76.0
191
+ version: 0.79.0
192
192
  type: :development
193
193
  prerelease: false
194
194
  version_requirements: !ruby/object:Gem::Requirement
195
195
  requirements:
196
196
  - - "~>"
197
197
  - !ruby/object:Gem::Version
198
- version: 0.76.0
198
+ version: 0.79.0
199
199
  - !ruby/object:Gem::Dependency
200
200
  name: rubocop-rspec
201
201
  requirement: !ruby/object:Gem::Requirement
202
202
  requirements:
203
203
  - - "~>"
204
204
  - !ruby/object:Gem::Version
205
- version: 1.36.0
205
+ version: 1.37.1
206
206
  type: :development
207
207
  prerelease: false
208
208
  version_requirements: !ruby/object:Gem::Requirement
209
209
  requirements:
210
210
  - - "~>"
211
211
  - !ruby/object:Gem::Version
212
- version: 1.36.0
212
+ version: 1.37.1
213
213
  - !ruby/object:Gem::Dependency
214
214
  name: ruby-oci8
215
215
  requirement: !ruby/object:Gem::Requirement
@@ -338,7 +338,11 @@ files:
338
338
  - lib/avmtrf1/tools/runner/php.rb
339
339
  - lib/avmtrf1/tools/runner/php/docker.rb
340
340
  - lib/avmtrf1/tools/runner/red.rb
341
+ - lib/avmtrf1/tools/runner/trf1_dspace_base0.rb
342
+ - lib/avmtrf1/tools/runner/trf1_dspace_base0/deploy.rb
341
343
  - lib/avmtrf1/tools/version.rb
344
+ - lib/avmtrf1/trf1_dspace_base0/deploy.rb
345
+ - lib/avmtrf1/trf1_dspace_base0/instance.rb
342
346
  - template/avmtrf1/php/docker_image/Dockerfile.template
343
347
  - template/avmtrf1/php/docker_image/aux/apache_foreground.sh
344
348
  - template/avmtrf1/php/docker_image/aux/config_banner.sh
@@ -350,6 +354,7 @@ files:
350
354
  - template/avmtrf1/php/docker_image/aux/setup_apache_site.sh
351
355
  - template/avmtrf1/php/docker_image/aux/start.sh
352
356
  - template/avmtrf1/php/docker_image/aux/templates/apache_site.conf
357
+ - template/avmtrf1/trf1_dspace_base0/deploy/build.properties.template
353
358
  homepage: http://redmine.trf1.gov.br/projects/avm-trf1
354
359
  licenses: []
355
360
  metadata: {}