Greatly updates scripts/shell/job/gp/install-gp.sh script

This commit is contained in:
Matheus Albino Brunhara
2024-04-12 14:40:47 -03:00
parent 53c5807354
commit 69881d7bbf

View File

@@ -7,6 +7,7 @@ show_help() {
echo " --version | --version (Required) Specify the GP version to install" echo " --version | --version (Required) Specify the GP version to install"
echo " --no-download true | --no-dl true (Optional) Make the script not download the files from Artifactory" echo " --no-download true | --no-dl true (Optional) Make the script not download the files from Artifactory"
echo " --no-webmap true | --no-wm true (Optional) Make the script not install the WebMap module" echo " --no-webmap true | --no-wm true (Optional) Make the script not install the WebMap module"
echo " --no-gp true | --no-gp true (Optional) Make the script not install GP"
echo " --install-apache true (Optional) Make the script install the Apache dependency for WebMap module" echo " --install-apache true (Optional) Make the script install the Apache dependency for WebMap module"
} }
@@ -14,6 +15,7 @@ version=''
should_download=true should_download=true
should_install_webmap=true should_install_webmap=true
should_install_apache=false should_install_apache=false
should_install_gp=true
while [ "$#" -gt 0 ]; do while [ "$#" -gt 0 ]; do
case "$1" in case "$1" in
@@ -21,11 +23,18 @@ while [ "$#" -gt 0 ]; do
--version|-v) version="$2"; shift 2;; --version|-v) version="$2"; shift 2;;
--no-download|--no-dl) should_download=false; shift 2;; --no-download|--no-dl) should_download=false; shift 2;;
--no-webmap|--no-wm) should_install_webmap=false; shift 2;; --no-webmap|--no-wm) should_install_webmap=false; shift 2;;
--no-gp|--no-gp) should_install_gp=false; shift 2;;
--install-apache) should_install_apache=true; shift 2;; --install-apache) should_install_apache=true; shift 2;;
*) shift ;; *) shift ;;
esac esac
done done
if [ -z "$version" ]; then
echo "You must specify the package version!"
echo "Example: `basename "$0"` --version 12.0.0.0.0-SNAPSHOT"
exit 1
fi
root_dir=`pwd` root_dir=`pwd`
if [ `basename $root_dir` != "$version" ]; then if [ `basename $root_dir` != "$version" ]; then
@@ -37,12 +46,6 @@ fi
scripts_folder=$HOME/repos/personal/personal-devboot/scripts/shell/job/gp scripts_folder=$HOME/repos/personal/personal-devboot/scripts/shell/job/gp
if [ -z "$version" ]; then
echo "You must specify the package version!"
echo "Example: `basename "$0"` --version 12.0.0.0.0-SNAPSHOT"
exit 1
fi
if [ ! -d "$scripts_folder" ]; then if [ ! -d "$scripts_folder" ]; then
echo "The git repository \"CloudAlb/personal-devboot\" must be in the \"~/repos\" folder!" echo "The git repository \"CloudAlb/personal-devboot\" must be in the \"~/repos\" folder!"
exit 1 exit 1
@@ -126,6 +129,7 @@ fi
# cpqd-msgs-map-1.8.7-RC02-bin.zip cpqd-msgs-package-1.8.7-RC02-bin.zip wildfly-15.0.0.Final.zip wildfly-8.2.1.zip # cpqd-msgs-map-1.8.7-RC02-bin.zip cpqd-msgs-package-1.8.7-RC02-bin.zip wildfly-15.0.0.Final.zip wildfly-8.2.1.zip
cp /l/disk0/mbrunhara/gp/zips/* . cp /l/disk0/mbrunhara/gp/zips/* .
if $should_install_gp; then
# creating folders # creating folders
mkdir -p cpqd-folders/audit cpqd-folders/exportacoes cpqd-folders/updater cpqd-folders/dataloader cpqd-folders/virtualdisk mkdir -p cpqd-folders/audit cpqd-folders/exportacoes cpqd-folders/updater cpqd-folders/dataloader cpqd-folders/virtualdisk
@@ -175,8 +179,9 @@ xmlstarlet ed -L -N x="urn:jboss:domain:2.2" -s "//x:server/x:system-properties"
# adding ignore database version # adding ignore database version
$scripts_folder/$script_disable_dbversion_check_filename --deployments-dir $deployments_folder $scripts_folder/$script_disable_dbversion_check_filename --deployments-dir $deployments_folder
fi
if !should_install_webmap; then if ! $should_install_webmap; then
echo "[INFO] Skipping WebMap installation..." echo "[INFO] Skipping WebMap installation..."
exit 0 exit 0
fi fi
@@ -228,7 +233,7 @@ fi
rm $gp_superparent_pom_filename $cdk_superparent_pom_filename rm $gp_superparent_pom_filename $cdk_superparent_pom_filename
msgs_package_dir='msgs-package' msgs_package_dir=$root_dir/msgs-package
unzip -qq -d $msgs_package_dir $msgs_package_filename unzip -qq -d $msgs_package_dir $msgs_package_filename
mv $msgs_package_dir/**/* $msgs_package_dir mv $msgs_package_dir/**/* $msgs_package_dir
@@ -237,8 +242,9 @@ mv $msgs_package_dir/**/* $msgs_package_dir
find $msgs_package_dir -type f -name '*.sh' -exec chmod +x {} \; find $msgs_package_dir -type f -name '*.sh' -exec chmod +x {} \;
cd $root_dir
unzip -qq wildfly-15.0.0.Final.zip unzip -qq wildfly-15.0.0.Final.zip
wildfly15_folder='wildfly-15.0.0.Final' wildfly15_folder="$root_dir/wildfly-15.0.0.Final"
$msgs_package_dir/appServerConfigurator/bin/setup.sh $msgs_package_dir/appServerConfigurator/bin/setup.sh
@@ -256,7 +262,9 @@ unzip -qq -d $wildfly15_folder/standalone/data_dir/www/map $msgs_map_filename
sed -i 's/8788/8789/g' $wildfly15_folder/bin/runstandalone.sh sed -i 's/8788/8789/g' $wildfly15_folder/bin/runstandalone.sh
if should_install_apache; then find $wildfly15_folder -type f -name '*.sh' -exec chmod +x {} \;
if $should_install_apache; then
sudo apt install apache2 sudo apt install apache2
sudo a2enmod proxy sudo a2enmod proxy
sudo a2enmod proxy_http sudo a2enmod proxy_http