0

Scenario: Send an email after the build with the emailable-report.html. Am able to achieve the above scenario.

But when the build is completed in jenkins, target folder or test-output folder is not updated after build. which means the jenkins workspace is not updating the target folder or test-output folder after the build. Rather the Jenkins workspace remains with the code checked out from GIT repository.

I want the jenkins workspace to be updated after the build to email the latest emailable-report.html.

Script for the sending the email:

def reportPath = build.getWorkspace().child("test-output/emailable-report.html")
msg.setContent(reportPath.readToString(), "text/html")

Help me with this scenario.

Ansari
  • 3
  • 3

1 Answers1

-1

This is just because build is generating in wrong jenkins workspace due the wrong configuration that we have done earlier.

It should be something like

C:\Users\Ashv\.jenkins\workspace\projectname

and for this make sure the below configuration.

Goto Manage Jenkins>>Configure System>>Advanced

Home directory C:\Users\Ashv\.jenkins

Workspace Root Directory : ${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}

Build Record Root Directory: ${ITEM_ROOTDIR}/builds

here I am attaching my job screen for all configuration I have done. you can find the link of image

Shahriar
  • 13,460
  • 8
  • 78
  • 95