Jenkins - Publicação sobre SSH - UNSTABLE

0

Eu tenho um trabalho que envia artefatos de construção e um script de shell para outro servidor JBoss e executa esse script a partir do servidor Jenkins.

Aqui está o meu problema. Quando eu acionar o trabalho, ele funciona perfeitamente e executa esse script também no servidor JBoss.

Nesse script, o último comando inicia o serviço do JBoss. Depois disso, ele precisa sair do script após o início do JBoss. Mas ele inicia o serviço JBoss e sai desse script para que o servidor Jenkins se torne instável como resultado.

Saída do console do Jenkins:

Copy Artifact  and Deploy Script to Anon Server
Execute Deploy Script
#####DEPLOYMENT INITIATED at 20180111:1152####
Stopping JBoss Service..........
Stopping jboss: [  OK  ]
..........JBoss Service stopped!
Initiating deployment
Taking backup of old package....
tar: Removing leading '/' from member names
/product/jboss/standalone/deployments/xxx.war
Backup file /Portal_be_AVS_11Jan2018_1152.tgz created!
Deployment is in progress..........
Remove deployed WAR
Copy the latest release WAR to Jboss
#####DEPLOYMENT COMPLETED SUCCESSFULLY at 20180111:1152####
Starting JBoss Service..........
Starting jboss: creating directory /product/jboss/bin
[  OK  ]
..........JBoss Service started successfully!
SSH: Disconnecting configuration [PP-BUILD-Batch] ...
ERROR: Exception when publishing, exception message [Exec timed out or was interrupted \
after 120,006 ms]
Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
Warning: ‘Access Control for Builds’ in global security configuration is empty, so \
falling back to legacy behavior of permitting any downstream builds to be triggered
Finished: UNSTABLE

O script é:

echo "#####DEPLOYMENT COMPLETED SUCCESSFULLY at 'date +%Y%m%d:%H%M'####"
echo "Starting JBoss Service.........."
/usr/bin/sudo /etc/init.d/jboss start
sleep 20 JBOSSCNT='ps -ef | grep java | grep jboss | grep -v grep | wc -l'
if [ $JBOSSCNT -lt 1 ];
then
echo "EXIT 2: JBoss Service failed to start, immediate attention required!"
echo "..........Deployment not completed!"
exit 2
else
echo "..........JBoss Service started successfully!"
 fi
 else echo "EXIT 2: Build is not available to proceed, deployment stopped!" exit 2
    
por Anand surla 11.01.2018 / 08:37

0 respostas

Tags