Browse Source

HPCC-12750 Generate environment.xml during package install and configure

Call envgen to generate environment.xml to replace default environment.xml
in the repository. It will include changes of each component under <HPCC_INSTALL>/
componentfiles/configxml/ directory

Remove default environment.xml and INSTALL code in cmake configuration files
Remove generated environmen.xml under install directory
xwang2713 9 years ago
parent
commit
edfe9a472a

+ 6 - 0
initfiles/bash/etc/init.d/install-init.in

@@ -182,6 +182,12 @@ homePath=$(cat /etc/passwd | grep -e "^${user}:" | cut -d':' -f6)
 homeBase=$(dirname $homePath)
 echo ""
 
+# Generate environment.xml
+echo "Generate environment.xml"
+${path}/sbin/envgen -env ${path}/etc/HPCCSystems/rpmnew/environment.xml -ip . -roxienodes 1 -thornodes 1 -slavesPerNode 1 -o data4=/var/lib/[NAME]/hpcc-data4/[COMPONENT] -set_xpath_attrib_value Software/EclCCServerProcess/Option @name maxCompileThreads -set_xpath_attrib_value Software/EclCCServerProcess/Option @value 2 -override roxie,@allFilesDynamic,true -override roxie,@laxyOpen,smart -override roxie,@localSlave,true -override roxie,@slaveConfig,simple > /dev/null 2>&1 || exit 1
+cp ${path}/etc/HPCCSystems/rpmnew/environment.xml ${path}/testing/regress/environment.xml || exit 1
+echo ""
+
 # installing files
 installConfs "environment.conf" $configs/ 1 || exit 1
 installConfs "environment.xml" $configs/  1 || exit 1

+ 5 - 0
initfiles/bash/etc/init.d/uninstall-init.in

@@ -85,3 +85,8 @@ if [ "${DISTRIB_NAME}" = "ubuntu" ] &&
       [ -e /lib/systemd/system/dafilesrv@.service ] && rm -rf /lib/systemd/system/dafilesrv@.service
    fi
 fi
+# Remove generated environment.xml under install directory
+[ -e ${INSTALL_DIR}/etc/HPCCSystems/rpmnew/environment.xml ] && rm -rf ${INSTALL_DIR}/etc/HPCCSystems/rpmnew/environment.xml
+[ -e ${INSTALL_DIR}/testing/regress/environment.xml ] && rm -rf ${INSTALL_DIR}/testing/regress/environment.xml
+
+exit 0

+ 1 - 3
initfiles/etc/DIR_NAME/CMakeLists.txt

@@ -16,7 +16,6 @@
 ################################################################################
 configure_file("version.in" "version")
 configure_file("environment.conf.in" "environment.conf")
-configure_file("environment.xml.in" "environment.xml")
 FOREACH( iFILES
     ${CMAKE_CURRENT_BINARY_DIR}/environment.conf
     ${CMAKE_CURRENT_BINARY_DIR}/version
@@ -24,8 +23,7 @@ FOREACH( iFILES
     Install ( FILES ${iFILES}  DESTINATION .${CONFIG_DIR} COMPONENT Runtime )	#  Don't delete the "."
 ENDFOREACH ( iFILES)
 
-Install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/environment.xml DESTINATION .${CONFIG_DIR}/rpmnew COMPONENT Runtime ) 	#  Don't delete the "."
-Install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/environment.conf DESTINATION .${CONFIG_DIR}/rpmnew COMPONENT Runtime )
+Install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/environment.conf DESTINATION .${CONFIG_DIR}/rpmnew COMPONENT Runtime )     #  Don't delete the "."
 Install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/genenvrules.conf DESTINATION .${CONFIG_DIR}/rpmnew COMPONENT Runtime )
 
 ADD_SUBDIRECTORY(configmgr)

File diff suppressed because it is too large
+ 0 - 1084
initfiles/etc/DIR_NAME/environment.xml.in


+ 0 - 4
testing/regress/CMakeLists.txt

@@ -17,10 +17,6 @@
 HPCC_ADD_SUBDIRECTORY (hpcc)
 HPCC_ADD_SUBDIRECTORY (ecl)
 
-configure_file("environment.xml.in" "environment.xml")
-
-Install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/environment.xml DESTINATION "./testing/regress" COMPONENT Runtime )
-
 Install ( DIRECTORY download hpcc ecl DESTINATION "./testing/regress" COMPONENT Runtime
           USE_SOURCE_PERMISSIONS
           FILES_MATCHING

File diff suppressed because it is too large
+ 0 - 1084
testing/regress/environment.xml.in