From f47a9e419cbda0e90f9539fc6bfce17a95a0b11d Mon Sep 17 00:00:00 2001 From: "Cosvernauta.com" <47022269+Cosvernauta@users.noreply.github.com> Date: Fri, 21 Apr 2023 20:48:24 -0600 Subject: [PATCH 1/6] Create DeployExampleESB.conf Example para ESB --- Example/DeployExampleESB.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Example/DeployExampleESB.conf diff --git a/Example/DeployExampleESB.conf b/Example/DeployExampleESB.conf new file mode 100644 index 0000000..91a4239 --- /dev/null +++ b/Example/DeployExampleESB.conf @@ -0,0 +1,18 @@ +# Archivo de Configuracion para rdeployer.sh +# Sobre ambientes WebLogic +# 2018 (c) +###################################### +RUTAD=/Ruta/del/Domain/Home/ESB +APWAR=DeployExample.war +SRVNAMES=serverPto01 +# XML para reapuntes con ESB +PROJECTCONF=DeployExample.xml +######################## +# Variables por default +######################## +OSBKEY=osb +PROJECTNAME=default +RTJK=/Ruta/donde/tomar/ComponenteWAR +NODE=ExampleNode01 +RTINST=/ruta/del/servidor/RFC +DODEPLOY=esb From 6cd6a7f54af2e84bd67b4dbcb836c44fead348ad Mon Sep 17 00:00:00 2001 From: "Cosvernauta.com" <47022269+Cosvernauta@users.noreply.github.com> Date: Fri, 21 Apr 2023 20:50:40 -0600 Subject: [PATCH 2/6] Update DeployExample.conf Update values Weblogic --- Example/DeployExample.conf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Example/DeployExample.conf b/Example/DeployExample.conf index 0cd37a7..1cf496e 100644 --- a/Example/DeployExample.conf +++ b/Example/DeployExample.conf @@ -1,10 +1,12 @@ # Archivo de Configuracion para rdeployer.sh # Sobre ambientes WebLogic # 2018 (c) -#### Jimmy R.: jlili.salgado(a)gmail.com -RUTAWL=/Ruta/del/Domain/Home/Weblogic +####################################### +RUTAD=/Ruta/del/Domain/Home/Weblogic APWAR=DeployExample.war SRVNAMES=serverPto01 RTJK=/Ruta/donde/tomar/ComponenteWAR NODE=ExampleNode01 -RTINST=/ruta/del/servidor/RFC +RTINST=/ruta/para/copiar/componente/localmente +### DODEPLOY=[weblogic|jboss|esb] +DODEPLOY=weblogic From 9f4d4fa427efcdde46f3c043a986cb295ed07a70 Mon Sep 17 00:00:00 2001 From: "Cosvernauta.com" <47022269+Cosvernauta@users.noreply.github.com> Date: Fri, 21 Apr 2023 20:52:29 -0600 Subject: [PATCH 3/6] Update DeployExampleESB.conf Update Values ESB --- Example/DeployExampleESB.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Example/DeployExampleESB.conf b/Example/DeployExampleESB.conf index 91a4239..ec2128b 100644 --- a/Example/DeployExampleESB.conf +++ b/Example/DeployExampleESB.conf @@ -3,7 +3,7 @@ # 2018 (c) ###################################### RUTAD=/Ruta/del/Domain/Home/ESB -APWAR=DeployExample.war +APWAR=DeployExampleESB.jar SRVNAMES=serverPto01 # XML para reapuntes con ESB PROJECTCONF=DeployExample.xml @@ -13,6 +13,7 @@ PROJECTCONF=DeployExample.xml OSBKEY=osb PROJECTNAME=default RTJK=/Ruta/donde/tomar/ComponenteWAR -NODE=ExampleNode01 +NODE=ExampleNode01ESB RTINST=/ruta/del/servidor/RFC +### DODEPLOY=[weblogic|jboss|esb] DODEPLOY=esb From 90b8cdf64e9ef69d5cafb020b764974b8b2d9d80 Mon Sep 17 00:00:00 2001 From: "Cosvernauta.com" <47022269+Cosvernauta@users.noreply.github.com> Date: Tue, 25 Apr 2023 19:03:23 -0600 Subject: [PATCH 4/6] 4.2.9 --- rdeployer.sh | 127 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 75 insertions(+), 52 deletions(-) diff --git a/rdeployer.sh b/rdeployer.sh index 1a723ee..ef8eea3 100644 --- a/rdeployer.sh +++ b/rdeployer.sh @@ -32,6 +32,8 @@ U_HOUR="$(date '+%H%M')" U_DATE="$(date '+%Y%m%d')" U_TIME="${U_DATE}${U_HOUR}" U_MES="$(date '+%m')" +>version.txt # Inicializando, para cualquier tipo de error en primera ejecución. + if [ "${PluginLauncher}" == "UrbanCode" ] then if [ -f BNUMBER.prc ] @@ -51,7 +53,7 @@ APPLOG=${APNAME}.${BUILD_NUMBER}.log # 230319-1528 APPID=${APNAME}${BUILD_NUMBER} # 070919-1736 #[ "${CICD}" == "Jenkins" ] && APPLOG=${APNAME}.${BUILD_NUMBER}.log # 230319-1528 140921-0836 #[ "${CICD}" == "Jenkins" ] && APPID=${APNAME}${BUILD_NUMBER} || APPID=${APNAME} # 070919-1736 140921-0836 -VERSION="4.2.8" +VERSION="4.2.9" export monthnames=(Invalid Ene Feb Mar Abr May Jun Jul Ago Sep Oct Nov Dic) YEAR="$(date '+%Y')" MES=${monthnames[${U_MES#0}]} @@ -228,6 +230,9 @@ else if [ ${WARNG} -gt 0 ] then msg "Se encontraron que algunas instancias no estaban disponibles, checar salida del log en la url anteriormente mostrada" "WARN" + WARNINST=$(grep "Unable to contact" ${APPLOG}| awk '{print $5}'|sort|uniq) # 210323-1151 + msg "Instancias con problemas:" "WARN" + msg "${WARNINST}" "WARN" vEXIT=4 fi #[ "$NPROD" == "1" ] && RTINST=$(dirname $(grep "Starting task with path" ${APPLOG} | awk -F":" '{print $4}')) @@ -375,7 +380,7 @@ fnCheckInstJB() for HC in $(${JB_HOME}/bin/jboss-cli.sh ${OPTIONS} --command="ls host=") do grpInfo=$(${JB_HOME}/bin/jboss-cli.sh ${OPTIONS} --command="/host=${HC}:resolve-expression-on-domain" | grep ${Grp} | awk '{print $1,$5,$7}'| sed 's/{//g'|sed 's/"//g') - echo "${grpInfo}" >> ${APPLOG} + echo "${grpInfo}" | grep .. >> ${APPLOG} done done @@ -526,7 +531,7 @@ msg "Validando variables de entorno Jenkins:" "INFO" if [ -z ${WEBLOGIC_HOME} ] && [ -z ${APHOME} ] && [ -z ${JB_HOME} ] && [ -z ${OSB_HOME} ] && [ -z ${NPROD} ] && [ -z ${JAVA_HOME} ] then - msg "No esta configurado Plugin rdeployer correctamente en Jenkins" "ERROR" + msg "No esta configurado Plugin rdeployer correctamente en ${PluginLauncher}" "ERROR" exit 1 else msg "Variables set correctamente." "OK" @@ -598,44 +603,51 @@ fi fnEstructuraNew() { vCOMP=$1 -RUTA_COPIA="${RTINST}/${YEAR}/${MES}/${NRFC}" -msg "Creando comando para estructura de directorios:" "INFO" -msg "${RTINST}" "DEBUG" -msg "${YEAR}" "DEBUG" -msg "${MES}" "DEBUG" -CMD1="mkdir -p ${RUTA_COPIA}" -ssh -q ${IPSRV} "${CMD1}" -# 080320-2358 Se actualiza la forma de estructura con mas validaciones. -msg "Creando comando para mover instalación que exista:" "INFO" -msg "backup ${RTINST}/${vCOMP}.prev" "DEBUG" -CMD1="[ ! -d ${RTINST}/.bck ] && mkdir ${RTINST}/.bck" -CMD1="$CMD1;[ -f ${RTINST}/${vCOMP}.prev ] && mv ${RTINST}/${vCOMP}.prev ${RTINST}/.bck/${vCOMP}.prev.${U_TIME}" -msg "backup ${RTINST}/${vCOMP}" "DEBUG" -CMD1="$CMD1;[ -f ${RTINST}/${vCOMP} ] && cp -rp ${RTINST}/${vCOMP} ${RTINST}/${vCOMP}.prev" -CMD1="$CMD1;[ -d ${RTINST}/.bck ] && ls -ltr ${RTINST}/.bck/${vCOMP}.prev.${U_TIME}" -CMD1="$CMD1;[ -f ${RTINST}/${vCOMP}.prev ] && ls -ltr ${RTINST}/${vCOMP}.prev" - -msg "Creando comando para punto de montaje como liga suave:" "INFO" -msg "remove ${RTINST}/${vCOMP}" "DEBUG" -CMD1="$CMD1;[ -f ${RTINST}/${vCOMP} ] && rm -rf ${RTINST}/${vCOMP}" -msg "link ${RUTA_COPIA}/${vCOMP} ${RTINST}/${vCOMP}" "DEBUG" -CMD1="$CMD1;ln -s ${RUTA_COPIA}/${vCOMP} ${RTINST}/${vCOMP}" - -msg "Copiando el componente en el directorio:" "INFO" -msg "${RTJK}/${vCOMP}" "DEBUG" -msg "${IPSRV}:${RUTA_COPIA}/." "DEBUG" -scp -qrp ${RTJK}/${vCOMP} ${IPSRV}:${RUTA_COPIA}/. - -if [ $? -gt 0 ] -then - msg "Error al copiar el componente ${vCOMP}" "ERROR" +vFirmaActual=$(ssh -q ${IPSRV} "md5sum ${RTINST}/${vCOMP}" | awk '{print $1}') #250423-1837 +vFirmaNewComponente=$(md5sum ${RTJK}/${vCOMP} | awk '{print $1}') #250423-1837 + +if [ "${vFirmaActual}" != "${vFirmaNewComponente}" ]; then #250423-1837 + RUTA_COPIA="${RTINST}/${YEAR}/${MES}/${NRFC}" + msg "Creando comando para estructura de directorios:" "INFO" + msg "${RTINST}" "DEBUG" + msg "${YEAR}" "DEBUG" + msg "${MES}" "DEBUG" + CMD1="mkdir -p ${RUTA_COPIA}" + ssh -q ${IPSRV} "${CMD1}" + # 080320-2358 Se actualiza la forma de estructura con mas validaciones. + msg "Creando comando para mover instalación que exista:" "INFO" + msg "backup ${RTINST}/${vCOMP}.prev" "DEBUG" + CMD1="[ ! -d ${RTINST}/.bck ] && mkdir ${RTINST}/.bck" + CMD1="$CMD1;[ -f ${RTINST}/${vCOMP}.prev ] && mv ${RTINST}/${vCOMP}.prev ${RTINST}/.bck/${vCOMP}.prev.${U_TIME}" + msg "backup ${RTINST}/${vCOMP}" "DEBUG" + CMD1="$CMD1;[ -f ${RTINST}/${vCOMP} ] && cp -rp ${RTINST}/${vCOMP} ${RTINST}/${vCOMP}.prev" + CMD1="$CMD1;[ -d ${RTINST}/.bck ] && ls -ltr ${RTINST}/.bck/${vCOMP}.prev.${U_TIME}" + CMD1="$CMD1;[ -f ${RTINST}/${vCOMP}.prev ] && ls -ltr ${RTINST}/${vCOMP}.prev" + + msg "Creando comando para punto de montaje como liga suave:" "INFO" + msg "remove ${RTINST}/${vCOMP}" "DEBUG" + CMD1="$CMD1;[ -f ${RTINST}/${vCOMP} ] && rm -rf ${RTINST}/${vCOMP}" + msg "link ${RUTA_COPIA}/${vCOMP} ${RTINST}/${vCOMP}" "DEBUG" + CMD1="$CMD1;ln -s ${RUTA_COPIA}/${vCOMP} ${RTINST}/${vCOMP}" + + msg "Copiando el componente en el directorio:" "INFO" + msg "${RTJK}/${vCOMP}" "DEBUG" + msg "${IPSRV}:${RUTA_COPIA}/." "DEBUG" + scp -qrp ${RTJK}/${vCOMP} ${IPSRV}:${RUTA_COPIA}/. + + if [ $? -gt 0 ] + then + msg "Error al copiar el componente ${vCOMP}" "ERROR" exit 1 -fi + fi -msg "Ejecutando comandos de estructura:" "INFO" -msg "$CMD1" "DEBUG" -ssh -q ${IPSRV} "${CMD1}" -msg "Se termina ejecución" "OK" + msg "Ejecutando comandos de estructura:" "INFO" + msg "$CMD1" "DEBUG" + ssh -q ${IPSRV} "${CMD1}" + msg "Se termina ejecución" "OK" +else + msg "Componente tiene misma firma, se omite su copiado" "WARN" #250423-1837 +fi #250423-1837 } @@ -708,7 +720,7 @@ fnValidateFile() if [ ! -f ${FileVal} ]; then msg "No existe Archivo ${FileVal}, favor de validar" "ERROR" else - msg "${FileVal} correcto" "OK" + msg "${FileVal} seems right!" "DEBUG" fi } @@ -738,17 +750,11 @@ case "${CONN}" in ;; esac -#if [ "${CONN}" == "ERROR" ] -#then -# msg "No se puede obtener usuario y password en el archivo de configuracion" "ERROR" -# exit 1 -#else - msg "Datos de consola encontrados." "OK" - USER=$(echo $CONN | awk '{print $1}') - PASSWD=$(echo $CONN | awk '{print $2}') - IPSRV=$(echo $CONN | awk '{print $3}') - PORT=$(echo $CONN | awk '{print $4}') -#fi +msg "Datos de consola encontrados." "OK" +USER=$(echo $CONN | awk '{print $1}') +PASSWD=$(echo $CONN | awk '{print $2}') +IPSRV=$(echo $CONN | awk '{print $3}') +PORT=$(echo $CONN | awk '{print $4}') export USER export PASSWD @@ -791,7 +797,12 @@ fnPluginInfo() { case $1 in "weblogic") echo "===== PLUGIN VERSION =====" >> ${APPLOG} - ${JAVA_HOME}/bin/java -Xms${vMemoryIni} -Xmx${vMemoryMax} -cp ${WEBLOGIC_HOME}/server/lib/weblogic.jar weblogic.Deployer -version >> ${APPLOG} + if [ -f ${WEBLOGIC_HOME}/server/lib/weblogic.jar ]; then + ${JAVA_HOME}/bin/java -Xms${vMemoryIni} -Xmx${vMemoryMax} -cp ${WEBLOGIC_HOME}/server/lib/weblogic.jar weblogic.Deployer -version >> ${APPLOG} + else + msg "Plugin no encontrado en la ruta ${WEBLOGIC_HOME}" "ERROR" + exit 1 + fi if [ $? -gt 0 ] then @@ -800,6 +811,17 @@ case $1 in fi ;; + "jboss") # 210323-1151 + echo "===== PLUGIN VERSION =====" >> ${APPLOG} + + if [ -f ${JB_HOME}/bin/jboss-cli.sh ]; then + msg "JBoss CLI Detected" >> ${APPLOG} + else + msg "No se encuentra el archivo plugin para Jboss en ${JB_HOME}" "ERROR" + exit 1 + fi + ;; + "esb") if [ -f ${OSB_HOME}/osb/tools/configjar/setenv.sh ] then @@ -899,6 +921,7 @@ case $DODEPLOY in fnFirma ${NPROD} ${APWAR} # Variable NPROD obtenido de Jenkins ;; "jboss") + fnPluginInfo jboss # 210323-1151 msg "Plugin cargado: JBoss_CLI" "INFO" fnGetConsole JBoss [ "$NPROD" == "0" ] && fnTipoEstructuraInstall ${TYPEINST} # 120521-0111 From 95869d23231e20070b1c4c6b6f385ba919a35616 Mon Sep 17 00:00:00 2001 From: "Cosvernauta.com" <47022269+Cosvernauta@users.noreply.github.com> Date: Tue, 25 Apr 2023 19:03:44 -0600 Subject: [PATCH 5/6] 4.2.9 --- ROADMAP | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ROADMAP b/ROADMAP index cf34ed5..8260773 100644 --- a/ROADMAP +++ b/ROADMAP @@ -9,19 +9,24 @@ ROADMAP rdeployer-plugin para JK,UC # - (New) ANSICOLOR ahora se puede desactivar en conf. # # 4.2.2 - 140922-0120 - (Bug) Dependencia cuando es Rollback, de revisar componente, por lo cual ya no -# revisará si el componente existe en situaciones de RB. +# revisará si el componente existe en situaciones de RB. # # 4.2.4 - 240922-1347 - (Bug) Módulo JBoss al momento de stop y start. # - (New) Impresión de firma en txt, para complemento con Jenkins, -# usando un plugin llamado "Build Name and Description Setter". +# usando un plugin llamado "Build Name and Description Setter". # # 4.2.6 - 101022-1535 - (Bug) Modulo para problemas con rollbacks con error, se crea temp para los puntos -# de montaje de cada componente. fnErrorExecute, fnEstructuraTemp +# de montaje de cada componente. fnErrorExecute, fnEstructuraTemp # # 4.2.7 - 101022-2000 - (New) Funcion para obtener servers o instancias a nivel JBoss. # # 4.2.8 - 120123-2011 - (Fix) Se adecua intepretacion de JBoss 7.2 en adelante, para modos kill. # +# 4.2.9 - 210323-1151 - (Fix) Se realiza validacion que existan los plugins de cada uno (Weblogic/ESB/Jboss) +# - (New) Imprime las instancias cuando no estan disponibles para Weblogic como WARN. +# 250423-1837 - (Fix) Cuando componente coincida con el prev, se omite su instalacion y solo +# se ejecutara el deploy. +# # 4.2.x - - (Dev) Construir modulo fnValidaEstructuraRB para prev con FIX. # - (Dev) Checar estructura de xml, cuando es por RFC su instalacion. # - (Dev) Programacion de URL usando la que despliega JK en el plugin. From 2ae95e9e617f08f4c748f0e26a336a2399f70da9 Mon Sep 17 00:00:00 2001 From: "Cosvernauta.com" <47022269+Cosvernauta@users.noreply.github.com> Date: Tue, 25 Apr 2023 19:06:05 -0600 Subject: [PATCH 6/6] Add files via upload --- data/RD-000000.dat | 5 +++++ data/RD-000025.dat | 4 ++++ data/RD-000026.dat | 4 ++++ 3 files changed, 13 insertions(+) create mode 100644 data/RD-000000.dat create mode 100644 data/RD-000025.dat create mode 100644 data/RD-000026.dat diff --git a/data/RD-000000.dat b/data/RD-000000.dat new file mode 100644 index 0000000..1d6ed63 --- /dev/null +++ b/data/RD-000000.dat @@ -0,0 +1,5 @@ +ERR1="No space left on device" +ERR2="" +ERR3="" +SOL="Espacio lleno en el servidor, depurar el FS." + diff --git a/data/RD-000025.dat b/data/RD-000025.dat new file mode 100644 index 0000000..a15b231 --- /dev/null +++ b/data/RD-000025.dat @@ -0,0 +1,4 @@ +ERR1="Another session operation is in progress. Please retry later." +ERR2="" +ERR3="" +SOL="Sesiones atrapadas a nivel consola ESB, favor de revisar y/o liberar sesiones" diff --git a/data/RD-000026.dat b/data/RD-000026.dat new file mode 100644 index 0000000..6eff842 --- /dev/null +++ b/data/RD-000026.dat @@ -0,0 +1,4 @@ +ERR1="Connection refused (Connection refused); No available router to destination" +ERR2="" +ERR3="" +SOL="Consola (IP y puerto) no se alcanzan, validar que servidor se alcance"