2016-06-21 4 views
0

私はかなり長時間この頭を叩いていましたが、私はそれを理解できません。複数のSCMからプルして、Concourse CIのmvファイルをworkdir

現在、私は2つのリポジトリ(自然に2つの別個のディレクトリを作成しています)を引っ張って、Dockerfileを正常に実行するためにあるディレクトリから別のディレクトリにファイルを移動しようとしています。ここで

は私のpipeline.ymlファイルがどのように見えるかです:私は実際にコンコースに展開することができるパイプラインを掲載しました

--- 
jobs: 
- name: build-nexus-docker-image 
    public: false 
    plan: 
    - get: git-nexus-docker-images 
    trigger: true 
    - get: git-nexus-license 
    trigger: true 
    - task: mv-nexus-license 
    config: 
     platform: linux 
     image_resource: 
     type: docker-image 
     source: {repository: ubuntu, tag: "trusty"} 
     inputs: 
     - name: git-nexus-license 
     - name: git-nexus-docker-images 
     run: 
     path: /bin/sh 
     args: 
      - -c 
      - mv -v git-nexus-license/nexus.lic git-nexus-docker-images/nexus.lic; ls -la git-nexus-docker-images 
    - put: nexus-docker-image 
    params: 
     build: git-nexus-docker-images/ 

resources: 
- name: git-nexus-docker-images 
    type: git 
    source: 
    uri: [email protected]:dev/nexus-pro-dockerfile.git 
    branch: test 
    paths: [Dockerfile] 
    private_key: {{git_ci_key}} 

- name: git-nexus-license 
    type: git 
    source: 
    uri: [email protected]:secrets/nexus-information.git 
    branch: master 
    paths: [nexus.lic] 
    private_key: {{git_ci_key}} 

- name: nexus-docker-image 
    type: docker-image 
    source: 
    username: {{aws-token-username}} 
    password: {{aws-token-password}} 
    repository: {{ecr-nexus-repo}} 

。しかし、私は多くのことを試みましたが、私はこれを行う方法を理解することはできません。私はライセンスファイルをgit-nexus-licenseディレクトリからgit-nexus-docker-imagesディレクトリに移動する作業に取り掛かっています。私が行ったことはnexus.licファイルのmvには見えません。なぜなら、dockerイメージを構築しているときにディレクトリ内のそのファイルを見つけることができないからです。

編集:上記のコードを使用して「mv」nexus.licを正常に実行できましたが、ファイルが見つからないため、ビルドに失敗しています。私が間違っていることが分かりません。手動で行うとビルドが正しく機能しますが、コンコースでは失敗します。

答えて

4

私は間違っていたことを理解しました。いつものように小さなものでした。私は、新しいワークディレクトリであることをコンコースに伝えるymlファイルにoutputsを追加するのを忘れていました。ここでは(私のために働く)それが今のように見える方法は次のとおりです。

--- 
jobs: 
- name: build-nexus-docker-image 
    public: false 
    plan: 
    - get: git-nexus-docker-images 
    trigger: true 
    - get: git-nexus-license 
    trigger: true 
    - task: mv-nexus-license 
    config: 
     platform: linux 
     image_resource: 
     type: docker-image 
     source: {repository: ubuntu, tag: "trusty"} 
     inputs: 
     - name: git-nexus-license 
     - name: git-nexus-docker-images 
     outputs: 
     - name: build-nexus-dir 
     run: 
     path: /bin/sh 
     args: 
      - -c 
      - mv -v git-nexus-license/nexus.lic build-nexus-dir/nexus.lic; mv -v git-nexus-docker-images/* build-nexus-dir; ls -la build-nexus-dir; 
    - put: nexus-docker-image 
    params: 
     build: build-nexus-dir/ 

resources: 
- name: git-nexus-docker-images 
    type: git 
    source: 
    uri: [email protected]:dev/nexus-pro-dockerfile.git 
    branch: test 
    paths: [Dockerfile] 
    private_key: {{git_ci_key}} 

- name: git-nexus-license 
    type: git 
    source: 
    uri: [email protected]:secrets/nexus-information.git 
    branch: master 
    paths: [nexus.lic] 
    private_key: {{git_ci_key}} 

- name: nexus-docker-image 
    type: docker-image 
    source: 
    username: {{aws-token-username}} 
    password: {{aws-token-password}} 
    repository: {{ecr-nexus-repo}} 

私は、これがこの上で立ち往生誰に役立ちます願っています。 :)

関連する問題