Show console output of a downstream job in upstream work

I use Jenkins.

Jenkins has an upstrea job: A
Jenkins has the following job: B

Exit to the console log:

1
2
3

Console B log output:

A
B
C

What I'm trying to get is:

Is there any way I can get the console output of job B in the Job A and THEN event logs, decide whether the successful job “A” was successful or not (using the / grep log parsing keyword for failuer / errors, etc.) d.).

+3
source share
3 answers

, , . , : Job B A Parameterized Trigger Plugin . A B, A B.

+1

- curl

.

curl http://myJenkinsServer:9090/job/ProjectNamel/$childJobLastBuildNumber/consoleFull  | sed "s#<span class="timestamp"><b>##g;s#</b> </span># #g" 

... $childJobLastBuildNumber / # child/downstream.

curl sed - child/downstream , curl | sed.. .

0

.

, cat. " " block. , . " B" .

cat "$JENKINS_HOME/jobs/<PATH_TO_YOUR_JOB>/builds/$TRIGGERED_BUILD_NUMBER_<FOLDER_AND_JOB_NAME>/log"

, $TRIGGERED_BUILD_NUMBER_<FOLDER_AND_JOB_NAME> - , Jenkins.

, , .

. B . :

  • ,
  • ,
  • Mark this assembly as unstable if the running assembly is worse or equal
0
source

Source: https://habr.com/ru/post/1598738/


All Articles