Logging 詹金斯管道公司不';不打印完整日志

Logging 詹金斯管道公司不';不打印完整日志,logging,jenkins,makefile,jenkins-pipeline,Logging,Jenkins,Makefile,Jenkins Pipeline,我有一个生成文件: .PHONE: test REMOVE_IMG_ON_FAIL=true REMOVE_IMG_WHEN_DONE=true DOCKER_OPTS = --rm -t test: test-ubuntu14 test-ubuntu16 test-centos6 test-centos7 test-ubuntu14: $(eval ID:=$(shell docker build -f tests/Dockerfile-ubuntu14.04 . | tee

我有一个生成文件:

.PHONE: test
REMOVE_IMG_ON_FAIL=true
REMOVE_IMG_WHEN_DONE=true
DOCKER_OPTS = --rm -t
test: test-ubuntu14 test-ubuntu16 test-centos6 test-centos7

test-ubuntu14:
        $(eval ID:=$(shell docker build -f tests/Dockerfile-ubuntu14.04 . | tee /dev/stderr | awk 'END {print $$NF}'))
        docker run ${DOCKER_OPTS} -v ${PWD}/tests/hosts:/etc/hosts ${ID} \
                /ansible-role-this/tests/test.sh || { ${REMOVE_IMG_ON_FAIL} && docker rmi ${ID} && exit 1 ; }
        { ${REMOVE_IMG_WHEN_DONE} && docker rmi ${ID} ; } || true

test-ubuntu16:
        $(eval ID:=$(shell docker build -f tests/Dockerfile-ubuntu16.04 . | tee /dev/stderr | awk 'END {print $$NF}'))
        docker run ${DOCKER_OPTS} -v ${PWD}/tests/hosts:/etc/hosts ${ID} \
                /ansible-role-this/tests/test.sh || { ${REMOVE_IMG_ON_FAIL} && docker rmi ${ID} && exit 1 ; }
        { ${REMOVE_IMG_WHEN_DONE} && docker rmi ${ID} ; } || true

test-centos6:
        $(eval ID:=$(shell docker build -f tests/Dockerfile-centos6 . | tee /dev/stderr | awk 'END {print $$NF}'))
        docker run ${DOCKER_OPTS} -v ${PWD}/tests/hosts:/etc/hosts ${ID} \
                /ansible-role-this/tests/test.sh || { ${REMOVE_IMG_ON_FAIL} && docker rmi ${ID} && exit 1 ; }
        { ${REMOVE_IMG_WHEN_DONE} && docker rmi ${ID} ; } || true

test-centos7:
        $(eval ID:=$(shell docker build -f tests/Dockerfile-centos7 . | tee /dev/stderr | awk 'END {print $$NF}'))
        docker run ${DOCKER_OPTS} -v ${PWD}/tests/hosts:/etc/hosts ${ID} \
                /ansible-role-this/tests/test.sh || { ${REMOVE_IMG_ON_FAIL} && docker rmi ${ID} && exit 1 ; }
        { ${REMOVE_IMG_WHEN_DONE} && docker rmi ${ID} ; } || true
还有詹金斯档案

node {
  stage 'Checkout'
  checkout scm

  stage 'test'
  catchError {
    wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
      sh 'make test'
    }
  }
  step([$class: 'Mailer',
       notifyEveryUnstableBuild: true,
       recipients: emailextrecipients([[$class: 'CulpritsRecipientProvider'],
                                       [$class: 'RequesterRecipientProvider']])])
}
它工作正常,但由于某些原因,管道仅打印第一个test-ubuntu14输出,而不打印其余的输出。虽然他们肯定被处决了。不幸的是,这使调试过程复杂化

更新:作为解决方法,我使用了以下文件:

node {
  stage 'Checkout'
  checkout scm

  stage 'test'
  catchError {
    wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
      sh 'make test-ubuntu14'
      sh 'make test-ubuntu16'
      sh 'make test-centos6'
      sh 'make test-centos7'
    }
  }
  step([$class: 'Mailer',
       notifyEveryUnstableBuild: true,
       recipients: emailextrecipients([[$class: 'CulpritsRecipientProvider'],
                                       [$class: 'RequesterRecipientProvider']])])
}

无论如何,我仍然想知道如何打印single make测试的输出。

尝试将输出放入变量: 结果=sh脚本:“make test-ubuntu14”,返回stdout:true

只需打印变量即可 打印结果