2014-01-15 2 views

답변

0

이 경우 Multijob plugin을 사용할 수 있습니다.

예를 들어 간단히 구현하면 세 번째 (멀티 잡) 프로젝트가 생기고 두 개의 멀티 잡스 단계가 하나씩 있습니다. 당신은 구성 페이지의 '고급'버튼으로 각 단계와 사용 매개 변수에 대한 종료 코드의 동작을 지정할 수 있습니다


편집 같은에서 전달 파일로 파일 매개 변수를 (지원하지 않습니다 multijob 플러그인 당신이

프로젝트 A (__upstream)에 의해

이는 params.txt는 가짜입니다 수 그러나 수치

에게있는 브라우저), 파일 파라미터

upstream job

프로젝트 B (__downstream)는

Started by upstream project "__upstream" build number 8 
originally caused by: 
Started by user anonymous 
[EnvInject] - Loading node environment variables. 
Building on master in workspace /var/lib/jenkins/workspace/__downstream 
[__downstream] $ /bin/sh -xe /tmp/hudson4094819031189787422.sh 
+ touch params.txt 
[EnvInject] - Injecting environment variables from a build step. 
[EnvInject] - Injecting as environment variables the properties file path 'params.txt' 
[EnvInject] - Variables injected successfully. 
[__downstream] $ /bin/sh -xe /tmp/hudson1756581135746292166.sh 
+ cat params.txt 
+ env 
+ grep TEST 
+ sort 
TEST1=abc 
TEST3=xyz 
+ rm params.txt 
Finished: SUCCESS 
0,123,516에서 트리거 될 때 params.txt에 파일 파라미터

downstream job

결과이다

직접

Started by user anonymous 
[EnvInject] - Loading node environment variables. 
Building on master in workspace /var/lib/jenkins/workspace/__downstream 
Copying file to params.txt 
[__downstream] $ /bin/sh -xe /tmp/hudson5504289990867483427.sh 
+ touch params.txt 
[EnvInject] - Injecting environment variables from a build step. 
[EnvInject] - Injecting as environment variables the properties file path 'params.txt' 
[EnvInject] - Variables injected successfully. 
[__downstream] $ /bin/sh -xe /tmp/hudson8534892071758952425.sh 
+ cat params.txt 
TEST1=abc 
TEST3=xyz 

+ env 
+ sort 
+ grep TEST 
TEST1=abc 
TEST3=xyz 
+ rm params.txt 
Finished: SUCCESS 

를 트리거 할 때

결과 당신은 하류에서 파일을 터치해야한다, 그렇지 않으면 EnvInject 플러그인이없는 파일에 초크 및 파일을 제거 (또는 이름 변경)을 기억하므로 다음 실행은 재사용하지 않습니다 값

+0

특별히 FILE PARAMETER에 대한 추가 기능을 추가하는 것처럼 보이지는 않지만 조언 해 주시겠습니까? – ksdnlee

+0

당신은 파일 매개 변수에 맞습니다. 그러나 해결 방법을 사용하여 답변을 업데이트했습니다. – KeepCalmAndCarryOn

+0

params.txt를 터치하고 Project B의 환경 변수를 중복 삽입하는 단계가 아닌가요? 매개 변수가있는 트리거 플러그인에서 '파일에서 속성 사용'은 이미 사용자를 위해 수행합니다. – harish