0

Jenkins2.0 파이프 라인 프로젝트에서 어떻게 두 단계를 병렬로 실행할 수 있습니까? 예 : 다음 코드에서 병렬로 실행해야하는 두 단계, 즉 "Build_First_Repo"및 "Build_Second_Repo"를 병렬로 실행해야합니다.Jenkins2.0에서 병렬로 두 단계를 수행하는 방법 파이프 라인 프로젝트

stage "Build_First_Repo" 
    node { sh '''echo 'Build first repo' 
       source ~/.bashrc''' 
       export path_to_perl_library="/path/to/perl/lib/perl5/5.8.8" 
       perl -I <include_files> build_first_view.pl --inputfile ${input_params} 

     } 


stage "Build_Second_Repo" 
    node { sh '''echo 'Build second repo' 
       source ~/.bashrc''' 
       export path_to_perl_library="/path/to/perl/lib/perl5/5.8.8" 
       perl -I <include_files> build_second_view.pl --inputfile ${input_params} 

     } 

나는 "평행"키워드를 사용하려고 시도했지만 작동하지 않았습니다.

답변

0

단계가 스테이지 지시문의 일부이기 때문에 선언적 파이프 라인에서는 병렬 단계 내에서 스테이지를 실행할 수 없습니다. 선언적 흐름은 단계 -> 단계 -> 단계 -> 수행하는 실제 단계와 같습니다.

그러나 스크립트 파이프 라인에서이 작업을 수행 할 수 있습니다. 샘플은 다음과 같습니다.

node(){ 
    parallel first:{ 
    stage('stage1'){ 
     echo 'helloworld' 
    } 
    }, 
    second:{ 
    stage('stage2'){ 
     echo 'helloworld2' 
    } 
    } 
} 
관련 문제