Here is my buildflow which executes a shell script...
Remember buildflow is DSL which is Groovy..
-----------------------------------
def JobCode = "REL"
def JobName = build.environment.get( "JOB_NAME" )
def BuildURL = build.environment.get( "BUILD_URL" )
def BuildNum = build.environment.get( "BUILD_NUMBER" )
def RevNum = build.environment.get( "GIT_COMMIT" )
def WrkSpce = build.environment.get( "WORKSPACE" )
def svnUrl = build.environment.get( "SVN_URL" )
out.println "Running Build for: "+JobName
def PathToWorkSpace = "jobs/"+JobName+"/workspace/"
def script=WrkSpce+"/Tools/PomVersionUpdater.sh "+JobCode+"-"+RevNum+BuildNum
def executeOnShell(String command) {
return executeOnShell(command, new File(System.properties.'user.dir'))
}
private def executeOnShell(String command, File workingDir) {
println command
def process = new ProcessBuilder(addShellPrefix(command))
.directory(workingDir)
.redirectErrorStream(true)
.start()
process.inputStream.eachLine {println it}
process.waitFor();
return process.exitValue()
}
private def addShellPrefix(String command) {
commandArray = new String[3]
commandArray[0] = "sh"
commandArray[1] = "-c"
commandArray[2] = command
return commandArray
}
executeOnShell(script)
build(JobCode+"-applicant-beans-bld", "PathToWorkSpace": PathToWorkSpace)
build(JobCode+"-configuration-beans-bld", "PathToWorkSpace": PathToWorkSpace)
build(JobCode+"-unicas-framework-bld", "PathToWorkSpace": PathToWorkSpace)
build(JobCode+"-unicas-security-bld", "PathToWorkSpace": PathToWorkSpace)
parallel (
{
build(JobCode+"-applicant-gateway-ui-bld", "PathToWorkSpace":
PathToWorkSpace)
build(JobCode+"-evaluator-ui-bld", "PathToWorkSpace":
PathToWorkSpace)
build(JobCode+"-unicas-configuration-ws-bld", "PathToWorkSpace":
PathToWorkSpace)
},
{
build(JobCode+"-applicant-ui-bld", "PathToWorkSpace":
PathToWorkSpace)
build(JobCode+"-management-ui-bld", "PathToWorkSpace":
PathToWorkSpace)
build(JobCode+"-unicas-commonservices-bld", "PathToWorkSpace":
PathToWorkSpace)
},
{
build(JobCode+"-configuration-ui-bld", "PathToWorkSpace":
PathToWorkSpace)
build(JobCode+"-unicas-gateway-ws-bld", "PathToWorkSpace":
PathToWorkSpace)
build(JobCode+"-unicas-ws-bld", "PathToWorkSpace": PathToWorkSpace)
}
)
On Wednesday, October 15, 2014 at 5:48:27 AM UTC-4, niraj nandane wrote:
>
> I have installed "Build Flow Plugin" and created a build flow project .
> The commands like build("project-name") are working fine.
> I want to execute a shell script which is at /root/niraj/muscript.sh
> ,which build the system. so i am doing like this
> shell(" /root/niraj/muscript.sh") . But it is showing error.
>
> Started by user anonymous
> <http://vom-esx6-vm13.samgpunb.symantec.com:8080/user/null>
> ERROR: Failed to run DSL Scriptgroovy.lang.MissingMethodException
> <http://stacktrace.jenkins-ci.org/search?query=groovy.lang.MissingMethodException>:
> No signature of method: com.cloudbees.plugins.flow.FlowDelegate.shell()
> is applicable for argument types: (java.lang.String) values: [muscript.sh]
>
>
> can anyone tell me ? its urgent
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/18132294-6145-424d-941e-48e0e0aa434e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.