Skip to content

Commit

Permalink
Refactor installter and Makefile not to include PostgreSQL driver any…
Browse files Browse the repository at this point in the history
…more, as in WAR now. IQSS#6819
  • Loading branch information
poikilotherm committed Nov 17, 2020
1 parent 910546f commit bc10dae
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 37 deletions.
10 changes: 2 additions & 8 deletions scripts/installer/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
INSTALLER_ZIP_DIR=dvinstall
DISTRIBUTION_WAR_FILE=${INSTALLER_ZIP_DIR}/dataverse.war
GLASSFISH_SETUP_SCRIPT=${INSTALLER_ZIP_DIR}/as-setup.sh
POSTGRES_DRIVERS=${INSTALLER_ZIP_DIR}/pgdriver
API_SCRIPTS=${INSTALLER_ZIP_DIR}/setup-datasetfields.sh ${INSTALLER_ZIP_DIR}/setup-users.sh ${INSTALLER_ZIP_DIR}/setup-builtin-roles.sh ${INSTALLER_ZIP_DIR}/setup-dvs.sh ${INSTALLER_ZIP_DIR}/data ${INSTALLER_ZIP_DIR}/setup-identity-providers.sh ${INSTALLER_ZIP_DIR}/setup-all.sh ${INSTALLER_ZIP_DIR}/post-install-api-block.sh
JHOVE_CONFIG=${INSTALLER_ZIP_DIR}/jhove.conf
JHOVE_SCHEMA=${INSTALLER_ZIP_DIR}/jhoveConfig.xsd
Expand All @@ -15,9 +14,9 @@ installer: dvinstall.zip
clean:
/bin/rm -rf ${INSTALLER_ZIP_DIR} dvinstall.zip

dvinstall.zip: ${GLASSFISH_SETUP_SCRIPT} ${POSTGRES_DRIVERS} ${JSF_PATCH_DIR} ${DISTRIBUTION_WAR_FILE} ${API_SCRIPTS} ${JHOVE_CONFIG} ${JHOVE_SCHEMA} ${SOLR_SCHEMA} ${SOLR_CONFIG} ${PYTHON_FILES} ${INSTALL_SCRIPT}
dvinstall.zip: ${GLASSFISH_SETUP_SCRIPT} ${JSF_PATCH_DIR} ${DISTRIBUTION_WAR_FILE} ${API_SCRIPTS} ${JHOVE_CONFIG} ${JHOVE_SCHEMA} ${SOLR_SCHEMA} ${SOLR_CONFIG} ${PYTHON_FILES} ${INSTALL_SCRIPT}
@echo making installer...
zip -r dvinstall.zip ${GLASSFISH_SETUP_SCRIPT} ${POSTGRES_DRIVERS} ${JSF_PATCH_DIR} ${DISTRIBUTION_WAR_FILE} ${API_SCRIPTS} ${JHOVE_CONFIG} ${JHOVE_SCHEMA} ${SOLR_SCHEMA} ${SOLR_CONFIG} ${PYTHON_FILES} ${INSTALL_SCRIPT}
zip -r dvinstall.zip ${GLASSFISH_SETUP_SCRIPT} ${JSF_PATCH_DIR} ${DISTRIBUTION_WAR_FILE} ${API_SCRIPTS} ${JHOVE_CONFIG} ${JHOVE_SCHEMA} ${SOLR_SCHEMA} ${SOLR_CONFIG} ${PYTHON_FILES} ${INSTALL_SCRIPT}
@echo
@echo "Done!"

Expand Down Expand Up @@ -45,11 +44,6 @@ ${GLASSFISH_SETUP_SCRIPT}: as-setup.sh ${INSTALLER_ZIP_DIR}
@echo copying glassfish setup
/bin/cp as-setup.sh ${INSTALLER_ZIP_DIR}

${POSTGRES_DRIVERS}: pgdriver/postgresql-42.2.12.jar
mkdir -p ${POSTGRES_DRIVERS}
@echo copying postgres driver
/bin/cp pgdriver/postgresql-42.2.12.jar ${POSTGRES_DRIVERS}

${API_SCRIPTS}: ../api/setup-datasetfields.sh ../api/setup-users.sh ../api/setup-dvs.sh ../api/setup-identity-providers.sh ../api/setup-all.sh ../api/post-install-api-block.sh ../api/setup-builtin-roles.sh ../api/data ${INSTALLER_ZIP_DIR}
@echo copying api scripts
/bin/cp -R ../api/setup-datasetfields.sh ../api/setup-users.sh ../api/setup-dvs.sh ../api/setup-identity-providers.sh ../api/setup-all.sh ../api/post-install-api-block.sh ../api/setup-builtin-roles.sh ../api/data ${INSTALLER_ZIP_DIR}
Expand Down
1 change: 0 additions & 1 deletion scripts/installer/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ from scripts/installer (this directory):

install
glassfish-setup.sh
pgdriver (the entire directory with all its contents)

from scripts/api:

Expand Down
13 changes: 0 additions & 13 deletions scripts/installer/install
Original file line number Diff line number Diff line change
Expand Up @@ -840,19 +840,6 @@ sub setup_appserver {
# with the MacOS glassfish build...). Verify, and if still the case,
# add a check.

print "\nInstalling the PostgresQL driver for Payara5... ";
# system( "/bin/cp", "pgdriver/" . $postgres_jdbc, $glassfish_dir . "/glassfish/lib" );
my $pgdriver_success = copy("pgdriver/" . $postgres_jdbc, $glassfish_dir . "/glassfish/lib" );

unless ($pgdriver_success)
{
print "\n*********************\n";
print "ERROR! Failed to copy the postgres driver into " . $glassfish_dir . "/glassfish/lib - check the directory permissions!\n";
exit 1;
}

print "done!\n";

print "\n*********************\n";
print "PLEASE NOTE, SOME OF THE ASADMIN COMMANDS ARE GOING TO FAIL,\n";
print "FOR EXAMPLE, IF A CONFIGURATION SETTING THAT WE ARE TRYING\n";
Expand Down
15 changes: 0 additions & 15 deletions scripts/installer/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@
# expected dataverse defaults
apiUrl = "http://localhost:8080/api"

# there's now a single driver that works for all supported versions:
# jodbc.postgresql.org recommends 4.2 for Java 8.
# updated drivers may be obtained from
# https://jdbc.postgresql.org/download.html
pgJdbcDriver = "postgresql-42.2.12.jar"

# 0. A few preliminary checks:
# 0a. OS flavor:

Expand Down Expand Up @@ -441,15 +435,6 @@
print("Setting App. Server heap size (Xmx) to "+str(gfHeap)+" Megabytes")
config.set('glassfish','GLASSFISH_HEAP', str(gfHeap))

# 4b1. PostgresQL driver:
pg_driver_jarpath = "pgdriver/"+pgJdbcDriver

try:
copy2(pg_driver_jarpath, gfJarPath)
print("Copied "+pgJdbcDriver+" into "+gfJarPath)
except:
print("Couldn't copy "+pgJdbcDriver+" into "+gfJarPath+". Check its permissions?")

# 4c. create payara admin credentials file

userHomeDir = pwd.getpwuid(os.getuid())[5]
Expand Down

0 comments on commit bc10dae

Please sign in to comment.