首页 > 解决方案 > GoCD - 下游管道已安排并开始但未启动

问题描述

我在 Linux 机器上将 GO-CD 服务器和代理作为 Alpine Docker 容器运行

我正在通过 json 配置插件添加几个管道。服务器似乎启动了第一个管道并上传了所有材料。然后他触发 2 个下游管道来获取材料。

正在安排 2 个下游管道并将其分配给代理,但它们没有启动。

我已经停止了这些阶段以查看错误是否仍然存在并且它们也停止了。

2018-08-29 15:34:28,029 ERROR [85@MessageListener for WorkFinder] JMSMessageListenerAdapter:77 - Exception thrown in message handling by listener com.thoughtworks.go.server.messaging.scheduling.WorkFinder@2c731a16
java.lang.NullPointerException: null
2018-08-29 15:34:36,919 ERROR [85@MessageListener for WorkFinder] JMSMessageListenerAdapter:77 - Exception thrown in message handling by listener com.thoughtworks.go.server.messaging.scheduling.WorkFinder@2c731a16
java.lang.NullPointerException: null
2018-08-29 15:34:38,040 ERROR [85@MessageListener for WorkFinder] JMSMessageListenerAdapter:77 - Exception thrown in message handling by listener com.thoughtworks.go.server.messaging.scheduling.WorkFinder@2c731a16
java.lang.NullPointerException: null

这就是在存储库中配置某些管道的方式

{
  "format_version" : 3,
  "group": "group1",
  "name": "Test-Pipeline-Stage",
  "label_template": "${COUNT}",
  "enable_pipeline_locking" : false,
  "parameters": [],
  "materials": [
    {
      "type": "git",
      "url": ""
      }
    ],
  "stages": [
    {
      "name": "Test",
      "fetch_materials": true,
      "never_cleanup_artifacts": false,
      "clean_working_directory": false,
      "approval" : null,
      "jobs": [{
        "name": "RunUnittestAndCoverage",
        "run_instance_count" : "all",
        "environment_variables": [],
        "timeout": 1,
        "tabs": [
           {
             "name": "coverage",
             "path": "coverage/coverage.html/index.html"
           }
         ],
        "artifacts": [
          {
            "source":"project.tar.gz",
            "destination":"project_source",
            "type":"build"
          },
          {
            "source": "test_result.xml",
            "destination": "testoutput",
            "type": "test"
          },
          {
            "source": "coverage.html",
            "destination": "coverage",
            "type": "build"
          },
          {
            "source": "coverage.xml",
            "destination": "coverage",
            "type": "build"
          }
          ],
        "tasks":[
          {
            "type": "exec",
            "run_if": "passed",
            "on_cancel": null,
            "command":"tox"
          },
          {
           "type":"exec",
            "run_if": "passed",
            "on_cancel": null,
            "command":"/usr/bin/xmllint",
            "arguments": [
                "--format",
                "test_resulto.xml",
                "--output",
                "test_result.xml"
              ]
            },
          {
            "type":"exec",
            "run_if": "passed",
            "on_cancel": null,
            "command": "/bin/ls",
            "arguments":[
              "-al"
            ]
          },
          {
            "type":"exec",
            "run_if": "passed",
            "on_cancel": null,
            "command": "/bin/tar",
            "arguments":[
              "-cvzf",
              "project.tar.gz",
              "/godata/pipelines/Test-Pipeline-Stage"
            ]
          }
          ]
        }
      ]
    }
  ]
}

{
  "format_version" : 3,
  "group": "group1",
  "name": "Docker-Deployment-Pipeline-Stage",
  "label_template": "${COUNT}",
  "enable_pipeline_locking" : false,
  "parameters": [],
  "materials": [
      {
        "type": "dependency",
        "pipeline": "Build-Pipeline-Stage",
        "stage": "BuildPythonProduct",
        "name": "project_source"
      },
      {
        "type": "dependency",
        "pipeline": "Analyse-Pipeline-Stage",
        "stage":"Analyse",
        "name":"analyse_result"
      }
    ],
  "stages":[
    {
      "name": "BuildDockerImage",
      "fetch_materials": true,
      "never_cleanup_artifacts": false,
      "clean_working_directory": false,
      "approval" : null,
      "jobs":[
        {
          "name": "BuildImage",
          "run_instance_count" : "all",
          "environment_variables": [],
          "timeout": 1,
          "tasks": [
            {
                "type": "fetch",
                "artifact_origin": "gocd",
                "run_if": "any",
                "pipeline": "Build-Pipeline-Stage",
                "stage": "BuildPythonProduct",
                "job": "BuildAndUpLoadWheel",
                "is_source_a_file": true,
                "source": "docker/Dockerfile",
                "destination": ""
            },
            {
                "type": "fetch",
                "artifact_origin": "gocd",
                "run_if": "any",
                "pipeline": "Build-Pipeline-Stage",
                "stage": "BuildPythonProduct",
                "job": "BuildAndUpLoadWheel",
                "is_source_a_file": true,
                "source": "docker/production.ini",
                "destination": ""
            },
            {
                "type":"exec",
                "run_if": "passed",
                "on_cancel": null,
                "command":"/usr/bin/docker",
                "arguments": [
                 "build",
                 "-t",
                 "project_creator",
                 "."
              ]
            }
          ]
        }
      ]
    }
  ]
}

标签: javaspringgo-cd

解决方案


推荐阅读