Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use jenkins own mechanisms for archiving / managing artifacts #30

Merged
merged 6 commits into from Jan 26, 2021
Merged

Use jenkins own mechanisms for archiving / managing artifacts #30

merged 6 commits into from Jan 26, 2021

Conversation

pipapo-sl
Copy link
Contributor

@pipapo-sl pipapo-sl commented Apr 6, 2020

Jenkins robot-plugin holds its own copy of build artifacts under builds\x\robot-plugin and it has no possibility to mark old builds to delete. So the folder 'robot-plugin' is never cleaned up. (Jenkins offers a configurable Build Discarder Plugin for this). And the folder may be a copy of existing archived test results (Jenkins offers archiveArtifacts plugin for this).

When introducing following argument:

  • archiveDirName (default: robot-plugin)
    it is possible so suppress copying test results by jenkins robot-plugin and point to the 'archive' dir of jenkins to use jenkins own mechanisms for archiving / managing test results. Using archiveArtifacts it is possible to archive the results and using build discarder plugin it is possible to clean up old results.
  1. Archive results: archiveArtifacts artifacts: "${env.JOB_NAME} ${BUILD_ID}/**/*.*"
  2. Set archiveDirName to 'archive' in the robot step:
    robot( outputPath : "", passThreshold : 100, unstableThreshold: 100, outputFileName : "${env.JOB_NAME} ${BUILD_ID}/output.xml", reportFileName : "${env.JOB_NAME} ${BUILD_ID}/report.html", logFileName : "${env.JOB_NAME} ${BUILD_ID}/log.html", otherFiles : "**/*", archiveDirName : "archive" )

added arguments
- disableCopyFilesToBuildDir (default: false)
- archiveDirName (default: robot-plugin)
@asimell
Copy link
Contributor

asimell commented Jan 15, 2021

Hi @pipapo-sl , I know it's been a while, but there's been a few merged PRs since this was created which have created merge conflicts. Could you resolve those?

EDIT: Nevermind, I handled those.

@asimell
Copy link
Contributor

asimell commented Jan 19, 2021

Hi @pipapo-sl,

The current implementation doesn't provide the new configuration parameters in the snippet generator for pipelines or freestyle jobs. Could you please add necessary configurations to the jelly files with appropriate help texts?

@pipapo-sl
Copy link
Contributor Author

pipapo-sl commented Jan 19, 2021

Hi @asimell,
Sorry I am relative new to github, you were faster merging conflicts. Added new parameters to jelly config including descriptions, but just saw, that disableCopyFilesToBuildDir is not really needed, it may be implicated in class RobotPublisher, by doing:
if (!DEFAULT_JENKINS_ARCHIVE_DIR.equals(getArchiveDirName())) {
instead of:
if (!getDisableCopyFilesToBuildDir()) {
What do you think?

@asimell
Copy link
Contributor

asimell commented Jan 19, 2021

@pipapo-sl Feel free to modify your PR. Less new stuff means less stuff to maintain in the future. If the same functionality can be achieved by introducing less new configurations, I think it's worth doing.

remove parameter disableCopyFilesToBuildDir and implicate its value.
remove parameter disableCopyFilesToBuildDir and implicate its value.
@pipapo-sl
Copy link
Contributor Author

@asimell OK, thank you. I changed the code, including the original description of the proposal. Now the name 'disableCopyFilesToBuildDir' of the branch lost its meaning :).
Unfortunately I was a little too fast and my commit 610046f broke the checks, which are fixed with commit eb08acb, but they do not start again.

print Messages.robot_publisher_copying() and Messages.robot_publisher_done() only if copy is really done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants