詹金斯集装箱管道

时间:2019-10-23 15:37:53

标签: jenkins

我正在为POC项目之一使用自由式Jenkins作业。当我执行给定的代码时,它将在控制台输出中引发错误。有人可以帮我吗?

podTemplate(label: 'any', containers: [
    containerTemplate(name: 'git', image: 'alpine/git', ttyEnabled: true, command: 'cat')

  ],
  volumes: [
    hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock')
  ]
  ) {
    node('any') {
        stage('Check running containers') {
            container('docker') {
                // example to show you can run docker commands when you mount the socket
                sh 'hostname'                  
            }
        }
    }

错误日志

tmp/jenkins5203006702049827868.sh: 2: /tmp/jenkins5203006702049827868.sh: Syntax error: word unexpected (expecting ")")
Build step 'Execute shell' marked build as failure
Finished: FAILURE

0 个答案:

没有答案