fix if condition on pending stage

This commit is contained in:
Roberto Cirillo 2022-04-27 15:57:39 +02:00
parent fd6fbff1f8
commit d17a3c7995
1 changed files with 3 additions and 3 deletions

6
Jenkinsfile vendored
View File

@ -94,10 +94,10 @@ pipeline {
steps {
sh '''
echo "Cron build enabled. New deploy of ${TRIGGER_JOB} - ${TRIGGER_VERSION} will be added to the deploy file"
if( !(grep "${TRIGGER_JOB}" ${DEPLOY_FILE})) then
echo "${TRIGGER_JOB},${TRIGGER_VERSION}" >> ${DEPLOY_FILE}
if grep -q "${TRIGGER_JOB}" ${DEPLOY_FILE} then
echo "component ${TRIGGER_JOB} already added. Nothing to add."
else
echo "component ${TRIGGER_JOB} already added"
echo "${TRIGGER_JOB},${TRIGGER_VERSION}" >> ${DEPLOY_FILE}
'''
}
}