From c779b364e86ae63ba51aaf8f61e2cca0b4f523a3 Mon Sep 17 00:00:00 2001 From: Daniel Santos-Olivan Date: Wed, 5 May 2021 15:14:38 +0200 Subject: [PATCH] Jenkinsfile: grouping sh commands in blocks --- Jenkinsfile | 60 +++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a3bfeae49..4ac574737 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -129,35 +129,41 @@ pipeline unstash name: 'ubuntu_examples' sh 'tar -xvzf Dist/CARLA*.tar.gz -C Dist/' - sh 'DISPLAY= ./Dist/CarlaUE4.sh -RenderOffScreen --carla-rpc-port=3654 --carla-streaming-port=0 -nosound > CarlaUE4.log &' - sh 'SCRIPT_PID=$!' - sh 'sleep 5' - sh 'CARLA_PID=`pgrep -P ${SCRIPT_PID}`' - sh 'echo "Carla Port"' - sh 'echo ${CARLA_PID}' - sh 'make smoke_tests ARGS="--xml --python-version=3.7"' - sh 'kill $CARLA_PID' - sh 'sleep 5' + sh ''' + DISPLAY= ./Dist/CarlaUE4.sh -RenderOffScreen --carla-rpc-port=3654 --carla-streaming-port=0 -nosound > CarlaUE4.log & + SCRIPT_PID=$! + echo ${SCRIPT_PID} + sleep 5 + CARLA_PID=`pgrep -P ${SCRIPT_PID}` + echo ${CARLA_PID} + make smoke_tests ARGS="--xml --python-version=3.7" + kill $CARLA_PID + sleep 5 + ''' - sh 'DISPLAY= ./Dist/CarlaUE4.sh -RenderOffScreen --carla-rpc-port=3654 --carla-streaming-port=0 -nosound > CarlaUE4.log &' - sh 'SCRIPT_PID=$!' - sh 'sleep 5' - sh 'CARLA_PID=`pgrep -P ${SCRIPT_PID}`' - sh 'echo "Carla Port"' - sh 'echo ${CARLA_PID}' - sh 'make smoke_tests ARGS="--xml --python-version=2"' - sh 'kill $CARLA_PID' - sh 'sleep 5' + sh ''' + DISPLAY= ./Dist/CarlaUE4.sh -RenderOffScreen --carla-rpc-port=3654 --carla-streaming-port=0 -nosound > CarlaUE4.log & + SCRIPT_PID=$! + echo ${SCRIPT_PID} + sleep 5 + CARLA_PID=`pgrep -P ${SCRIPT_PID}` + echo ${CARLA_PID} + make smoke_tests ARGS="--xml --python-version=2" + kill $CARLA_PID + sleep 5 + ''' - sh 'DISPLAY= ./Dist/CarlaUE4.sh -RenderOffScreen --carla-rpc-port=3654 --carla-streaming-port=0 -nosound > CarlaUE4.log &' - sh 'SCRIPT_PID=$!' - sh 'sleep 10' - sh 'CARLA_PID=`pgrep -P ${SCRIPT_PID}`' - sh 'echo "Carla Port"' - sh 'echo ${CARLA_PID}' - sh 'make run-examples ARGS="localhost 3654"' - sh 'kill $CARLA_PID' - sh 'sleep 2' + sh ''' + DISPLAY= ./Dist/CarlaUE4.sh -RenderOffScreen --carla-rpc-port=3654 --carla-streaming-port=0 -nosound > CarlaUE4.log & + SCRIPT_PID=$! + echo ${SCRIPT_PID} + sleep 5 + CARLA_PID=`pgrep -P ${SCRIPT_PID}` + echo ${CARLA_PID} + make run-examples ARGS="localhost 3654 + kill $CARLA_PID + sleep 5 + ''' } post {