2017-11-28 1 views
0

나는 재료의 2 종류가 있습니다 업스트림 파이프 라인GoCD를 사용하여 2 가지 소재를 스테이지로 가져 오려면 어떻게해야합니까?

다운 스트림에서

  • 정적 자식의 repo는

  • 이슈 전 기능을 모두 필요로하는 AnalysisBuilders이 . 작업이 실행될 때 나는 git 저장소에만 액세스 할 수 있으며 '웹'아티팩트는 액세스 할 수없는 것 같습니다.

    XML :

    <pipeline name="FishAnalysis"> 
        <materials> 
        <git url="https://fish:[email protected]/fish/analysis.git" /> 
        </materials> 
        <stage name="CommitHandler" cleanWorkingDir="true"> 
        <jobs> 
         <job name="builder"> 
         <tasks> 
          <exec command="yarn" workingdir="web"> 
          <arg>install</arg> 
          <runif status="passed" /> 
          </exec> 
          <exec command="npm" workingdir="web"> 
          <arg>run</arg> 
          <arg>build</arg> 
          </exec> 
         </tasks> 
         <artifacts> 
          <artifact src="web/dist" dest="web" /> 
          <artifact src="web/package.json" dest="web" /> 
          <artifact src="web/node_modules" dest="web" /> 
          <artifact src="web/nginx.conf" dest="web" /> 
         </artifacts> 
         </job> 
        </jobs> 
        </stage> 
    </pipeline> 
    

    .....

    <pipeline name="AnalysisBuilders"> 
    
        <materials> 
         <pipeline pipelineName="FishAnalysis" stageName="CommitHandler" materialName="FishAnalysis" /> 
    
         <git url="https://fish:[email protected]/fish/docker.git" dest="docker" materialName="Docker"> 
         </git> 
    
        </materials> 
        <stage name="Builders"> 
         <jobs> 
         <job name="shellScripts"> 
          <tasks> 
          <exec command="ls"> 
           <arg>-R</arg> 
           <arg>.</arg> 
           <runif status="passed" /> 
          </exec> 
          </tasks> 
         </job> 
         </jobs> 
        </stage> 
    </pipeline> 
    

    나는 '웹'& '고정 표시기'폴더를하기 위해 LS에게 -R 출력을 기대. 그렇지 않습니다. 그것은 docker repo의 내용만을 가지고 있습니다. 두 재료를 모두 사용할 수 있도록하려면 어떻게해야합니까?

답변

1

아티팩트는 자동으로 다운 스트림 파이프 라인으로 전파되지 않습니다. 당신은 여기에 같이가, 유물 작업을 가져 추가해야합니다 유물은 여러 업스트림 작업에 게시 할 수 있습니다 각각의 상류 작업이 다른 유물을 게시 할 수 있기 때문에

<tasks> 
    <fetchartifact pipeline="FishAnalysis" stage="CommitHandler" job="builder" srcdir="web" dest="web"> 
    <runif status="passed" /> 
    </fetchartifact> 
    <exec command="ls"> 
    ... 
    </exec> 
</tasks> 

이입니다. AnalysisBuilder 파이프 라인의 업스트림 재질 정의에서 작업을 지정하지 않았습니다.

GoCD는 이물의 버전이 올바른지 확인합니다. 즉,이 파이프 라인을 실행시키는 업스트림 파이프 라인 인스턴스에 해당합니다. 파이프 라인을 나중에 다시 실행하더라도.

+0

위대한 작품 - 감사합니다. –

관련 문제