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

adding jenkins "discard old builds" feature #203

Merged
merged 1 commit into from
Mar 17, 2018

Conversation

sabari-karthik
Copy link

adding jenkins "discard old builds" feature

@katelovescode
Copy link
Contributor

@sab3d - if you're still interested in adding this functionality, please add documentation to the feature you're adding in the doc block above the method. Otherwise, please close this issue.

Copy link
Contributor

@katelovescode katelovescode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document these params in the doc block above the method

@@ -299,6 +299,16 @@ def build_freestyle_config(params)
xml.description
xml.keepDependencies "#{params[:keep_dependencies]}"
xml.properties
#buildlogs related stuff
if params[:discard_old_builds]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, this method build_freestyle_config only outputs the XML for a job config, rather than actually creating that job on the server. If so, this is 👍 to merge, I got response XML like this while using login_with_irb:

2.2.7 :001 > @client.job.build_freestyle_config({name: 'testjob', discard_old_builds: {daysToKeep: 3, numToKeep: 1, artifactDaysToKeep: 1, artifactNumToKeep: 1}})
 => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project>\n  <actions/>\n  <description/>\n  <keepDependencies>false</keepDependencies>\n  <properties/>\n  <logRotator class=\"hudson.tasks.LogRotator\">\n    <daysToKeep>3</daysToKeep>\n    <numToKeep>1</numToKeep>\n    <artifactDaysToKeep>1</artifactDaysToKeep>\n    <artifactNumToKeep>1</artifactNumToKeep>\n  </logRotator>\n  <scm class=\"hudson.scm.NullSCM\"/>\n  <canRoam>true</canRoam>\n  <disabled>false</disabled>\n  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>\n  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>\n  <triggers class=\"vector\"/>\n<concurrentBuild>false</concurrentBuild>\n  <builders/>\n  <publishers/>\n  <buildWrappers/>\n</project>\n"

@arangamani as long as I understand this correctly, can you 👍 and merge?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@katelovescode Go for it

Copy link
Contributor

@katelovescode katelovescode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good barring my comment being wrong.

@arangamani arangamani self-assigned this Feb 13, 2018
@katelovescode katelovescode merged commit 9f6af46 into arangamani:master Mar 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants