Jenkins - simply robocopy in Jenkins finishes marks build with failure

0 votes
I’m trying to run a simple robocopy that returns zero errors but when I try to run the same in Jenkins i’m getting the following error.

D:\Jenkins\jobs\Jenkins Config Backup\workspace>exit 1 Build step 'Execute Windows batch command' marked build as failure Finished: FAILURE
Aug 6, 2018 in Jenkins by Hannah
• 18,520 points
3,565 views

1 answer to this question.

0 votes

robocopy returns a bit map

This is the batch file code I usually use:

set SOURCE= ...
set DESTINATION= ...
robocopy /MIR /LOG:example.robocopy.log.txt %SOURCE% %DESTINATION%
@echo robocopy exit code: %ERRORLEVEL%
@if %ERRORLEVEL% GTR 3 ( echo robocopy ERROR )
@if %ERRORLEVEL% GTR 3 ( exit %ERRORLEVEL% )
@set ERRORLEVEL=0

You could also do a "goto" and not exit.

answered Aug 6, 2018 by Kalgi
• 52,350 points

Related Questions In Jenkins

0 votes
1 answer

Why is it displaying Jenkins build failure for Android app

I think you should try this. Try Uninstalling ...READ MORE

answered Apr 12, 2018 in Jenkins by shubham
• 7,340 points
1,775 views
+2 votes
5 answers
0 votes
1 answer

sonar XML plugin installation failure in jenkins

You can try the SonarQube XML plugin. ...READ MORE

answered Jun 21, 2018 in Jenkins by Atul
• 10,240 points
968 views
+1 vote
3 answers

How to auto build a job in jenkins if there is any change in code on Github repository?

To automatically run build on code commit, follow ...READ MORE

answered Jul 31, 2019 in Jenkins by Sirajul
• 59,230 points
78,761 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
+2 votes
1 answer
0 votes
1 answer

Jenkins- Build Date in Jenkins Email

Install the zentimestamp plugin. This plugin exports a BUILD_TIMESTAMP variable. ...READ MORE

answered Nov 14, 2018 in Jenkins by Kalgi
• 52,350 points
9,895 views
0 votes
1 answer

Empty Jenkins Workspace causing Jenkins build failure

/tmp/hudson3579240812233061648.sh: line 3: cd: /jenkins/workspace/completeness_compiler_runtime_tests/TPS/qel/automation/tools The error is ...READ MORE

answered Aug 8, 2018 in Jenkins by Kalgi
• 52,350 points
9,433 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP