Jenkins build status always shows success

25 views
Skip to first unread message

Vijay Gongle

unread,
Jan 10, 2020, 4:23:26 PM1/10/20
to Jenkins Users
Hello,
This is something weird I started seeing from past 2 days. No matter what or how many errors you have in console output, it shows the results as “success” and green and never marks the status “failed” at the end.

This job has been working fine for months.
I created a new job with similar configuration and script, it still behaves the same way.

I’m sure someone can help me with it.

Thanks in advance!
Vijay

RAJENDRA PRASAD

unread,
Jan 10, 2020, 11:28:26 PM1/10/20
to jenkins...@googlegroups.com
Could you please elaborate on what kind of project you are running?
Running from Bash Shell of Jenkins build step or batch file?
i

Rajendra Prasad Reddy Penumalli



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/297b1845-300b-403a-b6a1-75df69a69c8a%40googlegroups.com.

Vijay Gongle

unread,
Jan 11, 2020, 5:59:23 AM1/11/20
to jenkins...@googlegroups.com
Correct. It’s an Angular project and running bash shell script of Jenkins build.

Thanks,
Vijay 
Sent from my iPhone

On Jan 10, 2020, at 11:28 PM, RAJENDRA PRASAD <rajendra....@gmail.com> wrote:



Jan Monterrubio

unread,
Jan 11, 2020, 4:47:00 PM1/11/20
to jenkins...@googlegroups.com
Does it mark unsuccessful if you have:
exit 1

As the last line of your script? Can you each out the result of your angular command? It might be pronting errors but exiting with a status of 0 which is considered successful. 



Vijay Gongle

unread,
Jan 12, 2020, 8:56:59 PM1/12/20
to jenkins...@googlegroups.com
I didn’t set the exit status to either 0 or 1. 

I did set it now to 1 and the status still shows success .

Thanks,
Vijay 

Sent from my iPhone

On Jan 11, 2020, at 4:46 PM, Jan Monterrubio <janmont...@gmail.com> wrote:



RAJENDRA PRASAD

unread,
Jan 12, 2020, 11:30:40 PM1/12/20
to jenkins...@googlegroups.com
Impossible,
Could you please paste code snippet that you are using to set exit status 1...
 

Thanks and Regards,
Rajendra Prasad Reddy Penumalli



Jérôme Godbout

unread,
Jan 13, 2020, 9:31:14 AM1/13/20
to jenkins...@googlegroups.com

Just asking, is the shell script (bat or sh) argument are set

returnStatus = false, returnStdout = false

 

or if the default did changes into recent release? If not into Jenkinsfiles, is the API into the plugin did modify anything?

Maybe this sound obvious but sound like something like that did changes and is not backward compatible.

 

 


36E56279

une compagnie 

RAPPROCHEZ LA DISTANCE

Jérôme Godbout
Développeur Logiciel Sénior / 
Senior Software Developer

p: +1 (418) 800-1073 ext.:109

amotus.ca
statum-iot.com

   

 

Vijay Gongle

unread,
Jan 13, 2020, 4:10:37 PM1/13/20
to jenkins...@googlegroups.com
Hello @Jerome @Rajendra: 

Below is the sh script from the build step of the job: 

#!/bin/bash

TIMESTAMP=$(date "+%Y_%m_%dT%T")
#ssh -o ServerAliveInterval=100 ec2-...@xxfff.f.fff -tt "cd /home/ec2-user/xxx-eportal2-myportalui"
#scp -r $WORKSPACE/* ec2-...@xx224.9.xxx:/home/ec2-user/xxx-eportal2-myportalui
#ssh -o ServerAliveInterval=100 ec2-...@xx224.9.xxx -tt "cd /home/ec2-user/xxx-eportal2-myportalui;chmod 755 -R *;npm install -i;npm run build;sudo node version.js $BUILD_NUMBER;sudo systemctl stop nginx;"
#ssh -o ServerAliveInterval=100 ec2-...@xx224.9.xxx -tt "cd /usr/share/nginx/html/portal2;sudo rm -rf *;"
#ssh -o ServerAliveInterval=100 ec2-...@xx224.9.xxx -tt "cd /home/ec2-user/xxx-eportal2-myportalui/dist;sudo cp -rf * /usr/share/nginx/html/;sudo systemctl start nginx;"

#######################aws s3 rm s3://enterpriseportal/portal2/angularapp/$env/$RELNO/myportal/ --recursive

#npm install
npm install -i

# get chromium (stable)
#yum install chromium

# install lighthouse


#build
npm run build

#deploy
NODE_ENV=$env release=$RELNO npm run deploy

#ssh -o ServerAliveInterval=100 ec2-user@xx13xxxxxx9 -tt "sudo -i sed -i \"s/^\(\s*\"$env\"_angularapp_myportal_release\s*:\s*\).*/\1$RELNO/\" /etc/puppetlabs/code/environments/production/hieradata/s3sync.yaml"
ssh -o ServerAliveInterval=100 ec2-user@xx13xxxxxx73 -tt 'sudo -i puppet apply -e "include base::hiera_git"'
################ssh ec2-user@xx13xxxxxx73 -tt "sudo -i sed -i \"s/^\(\s*s3sync\:\:\"$env\"_angularapp_myportal_release\s*:\s*\).*/\1$RELNO/\" /tmp/workspace_git/data/s3sync.yaml"
ssh -o ServerAliveInterval=100 ec2-user@xx13xxxxxx73 -tt 'sudo -i /etc/puppetlabs/puppet/scripts/updateyaml.sh'

ssh -o ServerAliveInterval=100 ec2-user@xx13xxxxxx73 -tt "sudo -i puppet apply -e \"include portal2::angularapp_sync\""


#Sonar
npm run sonar
node -v



Under which I have the exit code set to 1 but doesn't work with either 0 or 1 or blank. 

image.png

It's weird though. 

Please share your thoughts on fixing this. 

Thanks, 
Vijay
 

Reply all
Reply to author
Forward
0 new messages