Feature #5130
improve management of p2jpl.jar in deployment scripts
100%
History
#1 Updated by Greg Shah about 3 years ago
Our current devops scripting is implemented outside of FWD. We use Apache ant
to script a range of conversion project tasks including the import of the database. The p2jpl.jar
is an important dependency whose management is completely manual at this point. This leads to problems when we change the p2jpl.jar
in FWD but forget to drop and reinstall it in a runtime database.
I've discussed this with Eric, we think the best approach (for now) is:
- Add a target to copy the
p2jpl.jar
to/usr/share/java/p2jpl.jar
(or wherever it is needed on Windows) and then drop and reinstallp2jpl.jar
in the database.- This will need to use
sudo
similar to how we implement the installation of the spawner. - The location should be customizable in case the default is not appropriate for the customer's installation.
- It should only be done if the database target is PostgreSQL.
- This will need to use
- Add a dependency to
deploy.prepare
or possibly something else? We don't like thatdeploy.prepare
would have this dependency, but it is not clear if there is a better location. - Add a version UDF that is customized at build time similar to how we version FWD.
- Call the version UDF during server startup (only for PostgreSQL) and report if there is a mis-match of versions. Don't abend, just log it.
#2 Updated by Igor Skornyakov about 3 years ago
direnv
utility in the situations when additional steps are required after some common operation like build.
- define an alias
alias _R='eval $R'
on the.bashrc
file. - and definition of the
R
environment variable to the.envrc
file. For example the.envrc
in the FWD project root in my environment is:export R='./gradlew core; sudo cp build/lib/p2jpl.jar /usr/share/java; sudo chmod a+x /usr/share/java/p2jpl.jar'
- use
_R
command to build the project with additional post steps.
#3 Updated by Greg Shah about 3 years ago
Clever!
#4 Updated by Eric Faulhaber about 3 years ago
Greg Shah wrote:
Add a version UDF that is customized at build time similar to how we version FWD.
This already exists: Functions.getFWDVersion()
. To use it from SQL:
select getfwdversion();
For example:
p2j_test=# select getfwdversion(); getfwdversion ---------------------------- FWD v4.0.0_p2j_3821c_11521 (1 row)
#5 Updated by Eric Faulhaber about 3 years ago
Does anyone know why we have this in the "template" build_db.xml
(not really a template, but it tends to get copied across projects)?
<condition property="p2jpl.jar.path" value="${deploy.home.abs}/lib/p2jpl.jar" else="/usr/share/java/p2jpl.jar"> <isset property="isWindows" /> </condition>
This is used to set up the p2jpl.jar
installation during database import.
Why do we use the most current p2jpl.jar
version from ${deploy.home.abs}/lib/
only in the Windows case, while we use the most likely out-of-date version from /usr/share/java/
for non-Windows? It seems this was a deliberate choice, otherwise it would always be ${deploy.home.abs}/lib/p2jpl.jar
. A permissions issue, perhaps? Copying from ${deploy.home.abs}/lib/p2jpl.jar
seems like it would work on Linux for a developer build, but maybe not for certain customer environments?
#6 Updated by Constantin Asofiei about 3 years ago
Eric Faulhaber wrote:
Why do we use the most current
p2jpl.jar
version from${deploy.home.abs}/lib/
only in the Windows case, while we use the most likely out-of-date version from/usr/share/java/
for non-Windows? It seems this was a deliberate choice, otherwise it would always be${deploy.home.abs}/lib/p2jpl.jar
. A permissions issue, perhaps?
Correct, is a permission issue. The postgres
user will need to be able to read this file.