I have a pipeline job in Jenkins. Once it finishes , it archives some files. I need to display a particular file from the archived folder.
Example file is D:/1234/errorLog.txt
If job is failed , this path should be provided in the email. How can I achieve this ?
It should be able to access that folder from email, by clicking that link.
All files that are archived can be accessed via the Jenkins URL. So, for example if I had an archived errorLog.txt, I would be able to access it like this:
JENKINS_URL/job/JOB_NAME/BUILD_NUMBER/artifact/path/to/file/errorLog.txt
So if you were sending an email, the email would have to contain the formatted string with the Jenkins URL, Job name, and build number set.
You can also do this with folders. If you were to go to the artifacts root folder:
JENKINS_URL/job/JOB_NAME/BUILD_NUMBER/artifact
You would see the archived folders listed out:
So anyone clicking on the list would have the page open up in their browser.
Related
I have a Jenkins job that can process any number of files. However the File Parameter only lets the user select a single file.
Is there a way to select an arbitrary number of files or to select a directory? (I can work out the appriopriate files given a directory).
There seems to be no option for selecting a directory with a parameter.
Asking the user to enter the full path in a String parameter is very unfriendly.
I did consider using a File Parameter to select one file in the directory and then extracting the directory from this but in fact you just get the single file uploaded - there doesn't appear to be any directory information.
(Note: it isn't an option to run the job multiple times once for each file, the files need to be processed as a set.)
Any ideas?
During the the "input step", I need to make a binary file available for the user to download and validate.
Ideally as a clickable link directly in the input-step dialog if that is possible somehow?
"archive artifact" does not work, since the artifact only becomes visible after the job has finished.
A link directly to the file in workspace would be ideal, but there does not seem to exist a way for groovy to find out the URL to the workspace.
The html publisher might work. But the problem of linking to it from the input-step dialog remains.
you can try to copy your file to $JENKINS_HOME/userContent and then access it via https://YourJenkinsHost.com/jenkins/userContent/YourFileName
In my case after build completes zip file will be created .Is there any way to provide a direct link inside build (For ex : at left side where we see 'Console Output' in that location) so that on click it takes to download location or downloads directly.(So that user need not to go to location and download explicitly)
You can archive your zip file firstly.
Then you get it either inside the build page or from the last successful build page which is in the main job page.
https://xxxx/job/hello/lastSuccessfulBuild/artifact/
Using Editable Email Notification in Jenkins how do we get dynamic (report file name changing in workspace after every build) .pdf files attached in e-mail from workspace.
Example: Root/TestResults/*.pdf
Above will give all pdf attachments
Example: Root/TestResults/Final_Report_2015_11_07_06_47.pdf
Above path is giving same file when exist.
But file name is getting changed dynamically, i.e. Final_Report_XXXX_XX_XX_XX_XX.pdf.
Is there any way to get latest file based one dynamic report file name check.
i have more than 2 text files generating after running a particular job in jenkins and i want to attach this two text files in email-triggered after success of the job.
Here we are using Editable email plugin, through which we can attach only one file no more that one, any please suggest.
Editable Email Notification has an Attachment section and it use Ant script.when you require an email trigger at the end of your build including files as an attachment then it will be helpful for you to know Ant script work mainly on relative addressing rather than absolute addressing. so content in attachment pattern should be some thing like this
**/foldername/*.txt
(anyextension)
Note:make sure the folder exists in your job workspace and all your text files are placed in that folder.
Or the other way if you have files in workspace , then you can use a comma separated list of file names to trigger as an attachment.
Please Use Trigger in email ext plugin and use success Trigger.
Hope this helps to some extent