我想在job2中使用job1工作区(使用jenkins管道从CD转换为job1工作区),但是我遇到了错误

时间:2019-08-30 12:12:48

标签: jenkins jenkins-pipeline

我想在job2中使用job1工作区(使用jenkins管道从cd到job1工作区),但是我遇到了错误。

以耐久性级别运行:MAX_SURVIVABILITY org.codehaus.groovy.control.MultipleCompilationErrorsException:启动失败: WorkflowScript:5:意外字符:'\'@第5行,第14列。

   bat cd E:\Program Files (x86)\Jenkins\workspace\Job1

            ^

1个错误

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:150)
at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:120)
at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:132)
at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:350)
at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:139)
at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:110)
at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:234)
at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:168)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:943)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:605)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:561)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:522)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:320)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)

完成:失败 页面生成:Au

我尝试了以下到cd的管道,但是没有运气。无法更改目录

阶段“构建”

bat e:

bat cd E:\Program Files (x86)\Jenkins\workspace\Job1

bat "\"${tool 'MSBuils'}\" project1\project1.sln /p:WebPublishMethod=FileSystem /p:LastUsedBuildConfiguration=Release /p:LastUsedPlatform=AnyCPU /p:ExcludeApp_Data=False /p:publishUrl=C:\Published\ /p:DeleteExistingFiles=True"

请提供一种在job2中使用job1的詹金斯工作区的解决方案

编辑:

我看到了复制artifact(插件)的选项。但是我不想复制这些(因为文件夹结构会打扰)我只想将CD复制到job1工作区并运行我的MSbuild命令

0 个答案:

没有答案