[JIRA] (JENKINS-47717) Allow different "Discard Old Build" options per branch on multibranch pipelines

2019-10-17 Thread kalle.niemit...@procomp.fi (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Kalle Niemitalo commented on  JENKINS-47717  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow different "Discard Old Build" options per branch on multibranch pipelines   
 

  
 
 
 
 

 
 roe_p pinhas, AFAIK, it works OK in a Multibranch Pipeline, where each branch becomes a nested project that discards its builds independently from the other branches.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.186203.1509215223000.9665.1571321400473%40Atlassian.JIRA.


[JIRA] (JENKINS-47717) Allow different "Discard Old Build" options per branch on multibranch pipelines

2019-10-17 Thread ro...@outlook.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 roe_p pinhas commented on  JENKINS-47717  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow different "Discard Old Build" options per branch on multibranch pipelines   
 

  
 
 
 
 

 
 This solution/workaround doesn't seems to work. Let's say I have configured the pipeline to use: buildDiscarder(logRotator(numToKeepStr: env.BRANCH_NAME == 'master' ? '5' : '1')) This will be as an example build (branch) history: #1 master  #2 master  #3 master #4 master #5 master #6 master #7 feature #8 feature In this case according to the explanation of the policy when I build the master branch 5 times it will save them and will drop build#1 when I start the 6 build. If I build #7 as non master branch it will keep all the builds (#2-6) and on #8 it will remove #7 only.   However this is not the case, what really happens is that on build #7 it's evaluating the condition and now the value of the buildDiscarder is 1 so its removing all the builds and keeping #7 only regardless of the branch name (it doesn't evaluate each build with the corresponding branch name)  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.186203.1509215223000.9650.1571320980412%40Atlassian.JIRA.


[JIRA] (JENKINS-47717) Allow different "Discard Old Build" options per branch on multibranch pipelines

2019-07-25 Thread muntyanu.ro...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Roman Muntyanu edited a comment on  JENKINS-47717  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow different "Discard Old Build" options per branch on multibranch pipelines   
 

  
 
 
 
 

 
 A more sophisticated example of a per-branch clean-up policy  workaround .  Multibranch Pipeline. Declarative build.jenkinsfile.The policy:{code:none}| Branch name | # Builds | # Artifacts ||-|--|-|| master  |  100 |   1 || test|   10 |   1 || production  |   10 |   5 || feature/*   |5 |   1 || bug/*   |5 |   1 ||  |1 |   0 |{code}The solution:{code:groovy}pipeline {options {buildDiscarder(logRotator(// number of builds to keepnumToKeepStr: env.BRANCH_NAME ==~ /master/ ? '100' : env.BRANCH_NAME ==~ /production|test/ ?  '10' : env.BRANCH_NAME ==~ /feature\/.*|bug\/.*/ ? '5' : '1',// number of builds to keep the artifacts fromartifactNumToKeepStr: env.BRANCH_NAME ==~ /master|test/ ? '1' : env.BRANCH_NAME ==~ /production/ ?  '5' : env.BRANCH_NAME ==~ /feature\/.*|bug\/.*/ ? '1' : '0'))}.}{code}  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.186203.1509215223000.1456.1564091160820%40Atlassian.JIRA.


[JIRA] (JENKINS-47717) Allow different "Discard Old Build" options per branch on multibranch pipelines

2019-07-25 Thread muntyanu.ro...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Roman Muntyanu edited a comment on  JENKINS-47717  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow different "Discard Old Build" options per branch on multibranch pipelines   
 

  
 
 
 
 

 
 A more sophisticated example of a per-branch clean-up policy workaround  (thank you, [~richajam]!) .  Multibranch Pipeline. Declarative build.jenkinsfile.The policy:{code:none}| Branch name | # Builds | # Artifacts ||-|--|-|| master  |  100 |   1 || test|   10 |   1 || production  |   10 |   5 || feature/*   |5 |   1 || bug/*   |5 |   1 ||  |1 |   0 |{code}The solution:{code:groovy}pipeline {options {buildDiscarder(logRotator(// number of builds to keepnumToKeepStr: env.BRANCH_NAME ==~ /master/ ? '100' : env.BRANCH_NAME ==~ /production|test/ ?  '10' : env.BRANCH_NAME ==~ /feature\/.*|bug\/.*/ ? '5' : '1',// number of builds to keep the artifacts fromartifactNumToKeepStr: env.BRANCH_NAME ==~ /master|test/ ? '1' : env.BRANCH_NAME ==~ /production/ ?  '5' : env.BRANCH_NAME ==~ /feature\/.*|bug\/.*/ ? '1' : '0'))}.}{code}  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.186203.1509215223000.1459.1564091160868%40Atlassian.JIRA.


[JIRA] (JENKINS-47717) Allow different "Discard Old Build" options per branch on multibranch pipelines

2019-07-25 Thread muntyanu.ro...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Roman Muntyanu edited a comment on  JENKINS-47717  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow different "Discard Old Build" options per branch on multibranch pipelines   
 

  
 
 
 
 

 
 A more sophisticated example of a per-branch clean-up policy.  Multibranch Pipeline. Declarative build.jenkinsfile.The policy:{code:none}| Branch name | # Builds | # Artifacts ||-|--|-|| master  |  100 |   1 || test|   10 |   1 || production  |   10 |   5 || feature/*   |5 |   1 || bug/*   |5 |   1 ||  |1 |   0 |{code}The solution:{code: gradle groovy }pipeline {options {buildDiscarder(logRotator(// number of builds to keepnumToKeepStr: env.BRANCH_NAME ==~ /master/ ? '100' : env.BRANCH_NAME ==~ /production|test/ ?  '10' : env.BRANCH_NAME ==~ /feature\/.*|bug\/.*/ ? '5' : '1',// number of builds to keep the artifacts fromartifactNumToKeepStr: env.BRANCH_NAME ==~ /master|test/ ? '1' : env.BRANCH_NAME ==~ /production/ ?  '5' : env.BRANCH_NAME ==~ /feature\/.*|bug\/.*/ ? '1' : '0'))}.}{code}  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.186203.1509215223000.1435.1564091101141%40Atlassian.JIRA.


[JIRA] (JENKINS-47717) Allow different "Discard Old Build" options per branch on multibranch pipelines

2019-07-25 Thread muntyanu.ro...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Roman Muntyanu commented on  JENKINS-47717  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow different "Discard Old Build" options per branch on multibranch pipelines   
 

  
 
 
 
 

 
 A more sophisticated example of a per-branch clean-up policy. Multibranch Pipeline. Declarative build.jenkinsfile. The policy: 

 

| Branch name | # Builds | # Artifacts |
|-|--|-|
| master  |  100 |   1 |
| test|   10 |   1 |
| production  |   10 |   5 |
| feature/*   |5 |   1 |
| bug/*   |5 |   1 |
|  |1 |   0 |
 

 The solution: 

 

Unable to find source-code formatter for language: gradle. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, _javascript_, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml


pipeline {

options {
buildDiscarder(logRotator(
// number of builds to keep
numToKeepStr: env.BRANCH_NAME ==~ /master/ ? '100' :
  env.BRANCH_NAME ==~ /production|test/ ?  '10' :
  env.BRANCH_NAME ==~ /feature\/.*|bug\/.*/ ? '5' : '1',
// number of builds to keep the artifacts from
artifactNumToKeepStr: env.BRANCH_NAME ==~ /master|test/ ? '1' :
  env.BRANCH_NAME ==~ /production/ ?  '5' :
  env.BRANCH_NAME ==~ /feature\/.*|bug\/.*/ ? '1' : '0'
))
}

.
}
 

  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 
   

[JIRA] (JENKINS-47717) Allow different "Discard Old Build" options per branch on multibranch pipelines

2018-03-23 Thread ja...@time4tea.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 James Richardson commented on  JENKINS-47717  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow different "Discard Old Build" options per branch on multibranch pipelines   
 

  
 
 
 
 

 
 buildDiscarder(logRotator(numToKeepStr: env.BRANCH_NAME == 'master' ? '10' : '25'))    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.