[JIRA] [accurev-plugin] (JENKINS-22138) Add support for Accurev SCM

5 views
Skip to first unread message

mail@daniel-spilker.com (JIRA)

unread,
Oct 6, 2015, 2:20:01 PM10/6/15
to jenkinsc...@googlegroups.com
Daniel Spilker assigned an issue to Unassigned
 

Added a label for accurev-plugin because the DSL can also be added to that plugin through the Job DSL extension point.

Jenkins / New Feature JENKINS-22138
Add support for Accurev SCM
Change By: Daniel Spilker
Component/s: accurev-plugin
Assignee: Justin Ryan
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

mail@daniel-spilker.com (JIRA)

unread,
Apr 11, 2016, 3:08:01 PM4/11/16
to jenkinsc...@googlegroups.com
Daniel Spilker commented on New Feature JENKINS-22138
 
Re: Add support for Accurev SCM

The upcoming generic DSL (https://github.com/jenkinsci/job-dsl-plugin/pull/816) will enable support for the AccuRev plugin:

job('example') {
  scm {
    accurevSCM {
      serverName('')
      depot('')
      stream('')
      wspaceORreftree('')
      workspace('')
      reftree('')
      subPath('')
      filterForPollSCM('')
      synctime(true)
      cleanreftree(false)
      useSnapshot(true)
      dontPopContent(true)
      snapshotNameFormat('')
      directoryOffset('')
      ignoreStreamParent(true)
    }
  }
}

mail@daniel-spilker.com (JIRA)

unread,
Apr 18, 2016, 12:03:06 PM4/18/16
to jenkinsc...@googlegroups.com
Daniel Spilker resolved as Fixed
 
Change By: Daniel Spilker
Status: Open Resolved
Resolution: Fixed

mail@daniel-spilker.com (JIRA)

unread,
May 8, 2016, 5:48:02 PM5/8/16
to jenkinsc...@googlegroups.com
Daniel Spilker closed an issue as Fixed
Change By: Daniel Spilker
Status: Resolved Closed
Assignee: Daniel Spilker

arno@90a.nl (JIRA)

unread,
May 11, 2016, 2:22:01 AM5/11/16
to jenkinsc...@googlegroups.com
Arno Moonen commented on New Feature JENKINS-22138
 
Re: Add support for Accurev SCM

Assuming that this is included in the 1.46 release, it does not work for me.

I'm using a DSL Factory (see wiki) and have a method similar to this example:


{code:title=BuildPipeline.groovy}
class BuildPipeline {
	static def MultiJob createMultiJob(DslFactory dsl, ProductInfo productInfo) {
		dsl.multiJob(productInfo.name) {
			/* ... */
			scm {
				accurevSCM {
					serverName GlobalConfig.accuRevServerName
					depot GlobalConfig.accuRevServerName
					stream productInfo.accuRevStream
					ignoreStreamParent false
					wspaceORreftree 'wspace'
					useReftree false
					useWorkspace true
					noWspaceNoReftree false
					workspace productInfo.accuRevWorkspace
					cleanreftree false
					useSnapshot false
					dontPopContent true
					snapshotNameFormat ''
					synctime true
					reftree ''
					subPath ''
					filterForPollSCM ''
					directoryOffset ''
				}
			}
			/* ... */
		}
	}
}

This is called from my "main" Job DSL that includes the class, similar to BuildPipeline.createMultijob(this, instanceOfProduct).
I test the script locally using this "runner" script:

run-dsl.groovy
@GrabResolver(name='jenkins', root='http://repo.jenkins-ci.org/releases/')
@Grab('org.jenkins-ci.plugins:job-dsl-core:1.46')
import javaposse.jobdsl.Run

def testFiles = []

if (args.size() == 0) {
	def currentWorkingDir = new File('')
	testFiles = new FileNameFinder().getFileNames('', 'test_*.groovy').collect({
		def file = new File(it)
		return currentWorkingDir.toURI().relativize( file.toURI() ).toString()
	})
} else {
 testFiles = args
}

Run.main(testFiles as String[])

This results in the following exception:

Exceptions
Caught: javaposse.jobdsl.dsl.DslScriptException: (BuildPipeline.groovy, line 81) No signature of method: javaposse.jobdsl.dsl.help
ers.ScmContext.accurevSCM() is applicable for argument types: (template.BuildPipeline$_createMultiJob_closure2$_closure8$_closure1
0) values: [template.BuildPipeline$_createMultiJob_closure2$_closure8$_closure10@64df9a61]
javaposse.jobdsl.dsl.DslScriptException: (BuildPipeline.groovy, line 81) No signature of method: javaposse.jobdsl.dsl.helpers.ScmC
ontext.accurevSCM() is applicable for argument types: (template.BuildPipeline$_createMultiJob_closure2$_closure8$_closure10) value
s: [template.BuildPipeline$_createMultiJob_closure2$_closure8$_closure10@64df9a61]
        at javaposse.jobdsl.dsl.DslScriptLoader.runScript(DslScriptLoader.groovy:126)
        at javaposse.jobdsl.dsl.DslScriptLoader.this$2$runScript(DslScriptLoader.groovy)
        at javaposse.jobdsl.dsl.DslScriptLoader$_runScriptsWithClassLoader_closure1.doCall(DslScriptLoader.groovy:69)
        at javaposse.jobdsl.dsl.DslScriptLoader.runScriptsWithClassLoader(DslScriptLoader.groovy:59)
        at javaposse.jobdsl.dsl.DslScriptLoader.this$2$runScriptsWithClassLoader(DslScriptLoader.groovy)
        at javaposse.jobdsl.dsl.DslScriptLoader.runScripts(DslScriptLoader.groovy:44)
        at javaposse.jobdsl.dsl.DslScriptLoader$runScripts.call(Unknown Source)
        at javaposse.jobdsl.Run$_main_closure2.doCall(Run.groovy:37)
        at javaposse.jobdsl.Run.main(Run.groovy:34)
        at run-dsl.run(run-dsl.groovy:17)
Caused by: groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.dsl.helpers.ScmContext.accurevSCM() is app
licable for argument types: (template.BuildPipeline$_createMultiJob_closure2$_closure8$_closure10) values: [template.BuildPipeline
$_createMultiJob_closure2$_closure8$_closure10@64df9a61]
        at javaposse.jobdsl.dsl.AbstractExtensibleContext.methodMissing(AbstractExtensibleContext.groovy:21)
        at javaposse.jobdsl.dsl.AbstractContext.invokeMethod(AbstractContext.groovy)
        at template.BuildPipeline$_createMultiJob_closure2$_closure8.doCall(BuildPipeline.groovy:81)
        at template.BuildPipeline$_createMultiJob_closure2$_closure8.doCall(BuildPipeline.groovy)
        at javaposse.jobdsl.dsl.ContextHelper.executeInContext(ContextHelper.groovy:14)
        at javaposse.jobdsl.dsl.ContextHelper$executeInContext.call(Unknown Source)
        at javaposse.jobdsl.dsl.Job.scm(Job.groovy:535)
        at template.BuildPipeline$_createMultiJob_closure2.doCall(BuildPipeline.groovy:80)
        at javaposse.jobdsl.dsl.JobParent.processItem(JobParent.groovy:113)
        at javaposse.jobdsl.dsl.JobParent.multiJob(JobParent.groovy:86)
        at javaposse.jobdsl.dsl.DslFactory$multiJob.call(Unknown Source)
        at template.BuildPipeline.createMultiJob(BuildPipeline.groovy:65)
        at template.BuildPipeline$createMultiJob$1.callStatic(Unknown Source)
        at template.BuildPipeline.createPipeline(BuildPipeline.groovy:18)
        at template.BuildPipeline$createPipeline.call(Unknown Source)
        at SOME_SCRIPT_NAME.run(SOME_SCRIPT_NAME.groovy:16)
        at SOME_SCRIPT_NAME$run.call(Unknown Source)
        at javaposse.jobdsl.dsl.DslScriptLoader.runScript(DslScriptLoader.groovy:120)
        ... 9 more

arno@90a.nl (JIRA)

unread,
May 11, 2016, 3:50:01 AM5/11/16
to jenkinsc...@googlegroups.com

I thought that it might be because the plug-in is not on my class path when running the script this way, so I tried adding @Grab('org.jenkins-ci.plugins:accurev:0.6.35') to run-dsl.groovy.
Unfortunately this does not change anything.

mail@daniel-spilker.com (JIRA)

unread,
May 11, 2016, 4:02:02 AM5/11/16
to jenkinsc...@googlegroups.com

The automatically generated DSL is only available when running in Jenkins, see the second to last paragraph in https://github.com/jenkinsci/job-dsl-plugin/wiki/Automatically-Generated-DSL.

In 1.47 there will be changes to simplify testing outside of Jenkins. Maybe you can adapt that for the command line runner. See https://github.com/jenkinsci/job-dsl-plugin/pull/837/files.

arno@90a.nl (JIRA)

unread,
May 11, 2016, 5:50:02 AM5/11/16
to jenkinsc...@googlegroups.com

I'll look into that. Thanks for the quick response!

Reply all
Reply to author
Forward
0 new messages