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

[JENKINS-34085] Added support for Versionnumber Plugin (https://wiki.jenkins-ci.org/d… #818

Closed

Conversation

lunar-consultancy
Copy link

@jenkinsadmin
Copy link
Member

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

this.environmentPrefixVariable = environmentPrefixVariable
}

void skipFailedBuilds(boolean skipFailedBuilds) {
Copy link
Member

Choose a reason for hiding this comment

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

Please set the default parameter values to true. Further details: https://github.com/jenkinsci/job-dsl-plugin/blob/master/CONTRIBUTING.md

@lunar-consultancy lunar-consultancy changed the title Added support for Versionnumber Plugin (https://wiki.jenkins-ci.org/d… [JENKINS-34085] Added support for Versionnumber Plugin (https://wiki.jenkins-ci.org/d… Apr 7, 2016
@@ -1488,4 +1488,39 @@ class WrapperContextSpec extends Specification {
'key1' | 'key2' | 'key3' | null | 'key1' | 'key2' | 'key3' | ''
'key1' | 'key2' | 'key3' | 'key4' | 'key1' | 'key2' | 'key3' | 'key4'
}

def 'call versionNumber'() {
Copy link
Member

Choose a reason for hiding this comment

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

Sorry about this, I didn't review your test case, would you mind adding another TestCase for call versionNumber with all options'

@daspilker
Copy link
Member

Instead of fixing this PR, we can use the upcoming generic DSL support (#816) for the Version Number plugin. Example:

job('example') {
  wrappers {
    versionNumberBuilder {
      versionNumberString('1.0.0')
      environmentVariableName('VERSION')
      useAsBuildDisplayName(true)
      projectStartDate('2012-05-04')
      environmentPrefixVariable(null)
      buildsToday(null)
      buildsThisWeek(null)
      buildsThisMonth(null)
      buildsThisYear(null)
      buildsAllTime(null)
      skipFailedBuilds(false)
    }
  }
}

To be able to use versionNumber instead of versionNumberBuilder as wrapper name, you can open a PR for the Version Number plugin, like I did for the Gerrit Trigger plugin, see jenkinsci/gerrit-trigger-plugin#280.

job('example') {
wrappers {
versionNumber('1.0.0.${BUILDS_ALL_TIME}', 'VERSION') {
startDate()
Copy link
Member

Choose a reason for hiding this comment

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

try to find a better example with some values instead of just calling all methods without options

@daspilker daspilker closed this Jun 8, 2016
@Reamer
Copy link

Reamer commented Jun 9, 2016

@daspilker
How i can use this plugin with JobDSL?

@daspilker
Copy link
Member

@Reamer see my comment in JIRA: JENKINS-34085

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.

5 participants