Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/svn/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法将git资源传递给put方法_Git_Concourse_Concourse Resource Types - Fatal编程技术网

无法将git资源传递给put方法

无法将git资源传递给put方法,git,concourse,concourse-resource-types,Git,Concourse,Concourse Resource Types,我试图从git获取一个项目,并将其传递给下一个Put方法以运行脚本。 但是git资源对于下一个put方法不可用。不确定我是否遗漏了一些基本的东西,但作为CI-CD的新手,我无法找出确切的问题。 这是我的大厅管道: --- resource_types: - name: ssh type: docker-image source: repository: quay.io/henry40408/concourse-ssh-resource resources: - name

我试图从git获取一个项目,并将其传递给下一个Put方法以运行脚本。 但是git资源对于下一个put方法不可用。不确定我是否遗漏了一些基本的东西,但作为CI-CD的新手,我无法找出确切的问题。 这是我的大厅管道:

    ---
resource_types:
- name: ssh
  type: docker-image
  source:
    repository: quay.io/henry40408/concourse-ssh-resource

resources:
- name: rdt-blr-oc-1
  type: ssh
  source:
    host: 10.xx.xx.xx
    user: user1
    password: password1
- name: commit-etc
  type: git
  icon: gitlab
  source:
    uri: https://gitlab.com/etc.git
    username: ((ci_user))
    password: ((ci_user_password))
    branch: master

jobs:
  - name: run_file_to_remote_host
    serial: true
    public: true
    plan:
      - get: commit-etc
        trigger: false
        inputs: commit-etc
      - put: rdt-blr-oc-1
        params: 
          interpreter: /bin/sh
          path:
          inputs:
            - name: commit-etc
          outputs: 
            - name: commit-etc
          script: |
            hostname;
            HOSTNAME=`hostname`
            echo "Create Unique directory. "
            ls commit-vcode-etc // This directory is not available as failed to find this directory.

查看您的管道和描述,它看起来不像
put
操作最适合您正在尝试的操作。
put
将推送给定的资源,对于git资源,它将进行提交。但是,您正在尝试运行一个脚本来列出提交等资源的内容

要实现这一点,您需要将其作为任务步骤()运行,该步骤将commit etc资源作为输入。例如:

    jobs:
    - name: run_file_to_remote_host
      serial: true
      public: true
      plan:
        - get: commit-etc
          trigger: false
        - task: rdt-blr-oc-1
          config:
          platform: linux
          image: my-image #the image you'll use the run the script
          inputs:
          - name: commit-etc
          run:
            path: /bin/sh
            args:
            - |
              hostname;
              HOSTNAME=`hostname`
              echo "Create Unique directory. "
              ls commit-etc // This directory is not available as failed to find this directory.
这将获取从
get
步骤检索到的资源,并运行概述的脚本。此资源有助于掌握广场的基本原理以及如何将所有内容结合在一起: