Skip to content

Commit

Permalink
1272-update-installation-with-versioned-jar-files (#1284)
Browse files Browse the repository at this point in the history
  • Loading branch information
osuender authored Dec 10, 2024
1 parent 376d7fd commit a775681
Showing 1 changed file with 71 additions and 11 deletions.
82 changes: 71 additions & 11 deletions blackedition/blackedition_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -892,20 +892,24 @@ update_xynafactory () {
fi

echo -e "\n + Copy delivery items to ${INSTALL_PREFIX}/{revisions,server}/."
replace_child_dirs server/clusterproviders
replace_child_versioned_files server/conpooltypes
replace_child_dirs server/datamodeltypes
replace_dir server/lib ${INSTALL_PREFIX}/server/lib
replace_child_dirs server/orderinputsourcetypes
replace_child_dirs server/persistencelayers
copy_dir server/storage ${INSTALL_PREFIX}/server/storage
copy_dir server/resources ${INSTALL_PREFIX}/server/resources
copy_dir server/exceptions ${INSTALL_PREFIX}/server/exceptions
copy_dir func_lib ${INSTALL_PREFIX}/server/func_lib
copy_file server/product_lib.sh ${INSTALL_PREFIX}/server
copy_file server/Exceptions.xml ${INSTALL_PREFIX}/server
copy_file server/TemplateImplNew.zip ${INSTALL_PREFIX}/server
copy_file server/TemplateImpl.zip ${INSTALL_PREFIX}/server

${VOLATILE_RM} -rf ${INSTALL_PREFIX}/server/lib

${VOLATILE_MKDIR} -p ${INSTALL_PREFIX}/revisions/rev_workingset/saved/{services,sharedLibs,XMOM}
${VOLATILE_CP} -rp "./func_lib/" ${INSTALL_PREFIX}/server/.

#alles im server-Verzeichnis kopieren außer log4j2.xml, server.policy, xynafactory.sh
${VOLATILE_CP} -rp server ${INSTALL_PREFIX}/.

#log4j2.xml, server.policy, xynafactory.sh aus backup wiederherstellen
restore_file_from_dir ${INSTALL_PREFIX} server server.policy
restore_file_from_dir ${INSTALL_PREFIX} server log4j2.xml
restore_file_from_dir ${INSTALL_PREFIX} server xynafactory.sh
#weitere Ausnahmen:
#persistencelayers.xml aus backup wiederherstellen
restore_file_from_dir ${INSTALL_PREFIX} server/storage/persistence persistencelayers.xml

#Lizenzen
Expand Down Expand Up @@ -942,6 +946,62 @@ update_xynafactory () {
echo -e "\n Updating server directory finished.\n"
}

replace_dir () {
local SOURCE_DIR=$1
local TARGET_DIR=$2

rm -rf ${TARGET_DIR}
${VOLATILE_CP} -rp ${SOURCE_DIR} ${TARGET_DIR}
}

copy_dir () {
local SOURCE_DIR=$1
local TARGET_DIR=$2

${VOLATILE_MKDIR} -p ${TARGET_DIR}
${VOLATILE_CP} -rp ${SOURCE_DIR} ${TARGET_DIR}
}

copy_file () {
local SOURCE_FILE=$1
local TARGET_DIR=$2

${VOLATILE_MKDIR} -p ${TARGET_DIR}
${VOLATILE_CP} -rp ${SOURCE_FILE} ${TARGET_DIR}
}

replace_versioned_file () {
local SOURCE_FILE=$1
local TARGET_DIR=$2
local SOURCE_BASE_FILE=$(basename -- "$SOURCE_FILE")
local TARGET_BASE_FILE=${SOURCE_BASE_FILE//[0-9]\.[0-9]\.[0-9]/*}

rm -f ${TARGET_DIR}/${TARGET_BASE_FILE}
${VOLATILE_CP} -rp ${SOURCE_FILE} ${TARGET_DIR}
}

replace_child_dirs () {
local SOURCE_DIR=$1

${VOLATILE_MKDIR} -p ${INSTALL_PREFIX}/${SOURCE_DIR}
for dir in ${SOURCE_DIR}/*; do
if [ -d "${dir}" ]; then
replace_dir ${dir} ${INSTALL_PREFIX}/${dir}
fi
done
}

replace_child_versioned_files () {
local SOURCE_DIR=$1

${VOLATILE_MKDIR} -p ${INSTALL_PREFIX}/${SOURCE_DIR}
for file in ${SOURCE_DIR}/*; do
if [ -f "${file}" ]; then
replace_versioned_file ${file} ${INSTALL_PREFIX}/${SOURCE_DIR}
fi
done
}

install_license () {
echo -e "\n + Install Licenses";
for jar in ${1}/*.jar ; do
Expand Down

0 comments on commit a775681

Please sign in to comment.