尝试在Jenkins中捕获工件时出错

时间:2018-02-23 15:33:48

标签: jenkins build devops

我的任务是在Jenkin构建的构建过程中捕获工件。这是一个多阶段的管道,作为最后一个阶段,我已经添加了一个有希望实现这一目标的阶段。我对Jenkin来说相当新,所以这可能是一个明显的错误/错误,以更多的进步用户。

stage('collect and upload kickstart artifact') {
  steps {
    def server = Artifactory.server SERVER_ID

    def uploadSpec = """{
      "files": [
        {
           "pattern": "ks/*.cfg",
           "target": "bin-local-cei/ks/"
        },
      ]
    }"""
    server.upload(uploadSpec)

    def buildInfo = Artifactory.newBuildInfo()
    buildInfo.env.capture = true
    buildInfo.env.collect()
    buildInfo=server.upload(uploadSpec)
    server.publishBuildInfo(buildInfo)
  }
}

我收到以下错误 ...

WorkflowScript: 117: Expected a step @ line 117, column 9.
           def server = Artifactory.server SERVER_ID
           ^

WorkflowScript: 119: Expected a step @ line 119, column 9.
           def uploadSpec = """{
           ^

WorkflowScript: 127: Method calls on objects not allowed outside "script" blocks. @ line 127, column 9.
           server.upload(uploadSpec)
           ^

WorkflowScript: 129: Expected a step @ line 129, column 9.
           def buildInfo = Artifactory.newBuildInfo()
           ^

WorkflowScript: 130: Expected a step @ line 130, column 9.
           buildInfo.env.capture = true
           ^

WorkflowScript: 131: Expected a symbol @ line 131, column 9.
           buildInfo.env.collect()
           ^

WorkflowScript: 132: Expected a step @ line 132, column 9.
           buildInfo=server.upload(uploadSpec)
           ^

WorkflowScript: 133: Method calls on objects not allowed outside "script" blocks. @ line 133, column 9.
           server.publishBuildInfo(buildInfo)
           ^

WorkflowScript: 131: Missing required parameter: "message" @ line 131, column 9.
           buildInfo.env.collect()
           ^

9个错误

我通过博客,帖子和文章进行了挖掘,但我在这里遗漏了一些东西。任何援助将不胜感激。谢谢!

0 个答案:

没有答案