詹金斯“控制台输出"文件系统中的日志位置 [英] Jenkins "Console Output" log location in filesystem

查看:14
本文介绍了詹金斯“控制台输出"文件系统中的日志位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在创建此输出的同一作业中访问和 grep Jenkins 控制台输出作为构建后步骤.使用 >> 重定向日志log.txt 不是解决方案,因为我的构建步骤不支持.

I want to access and grep Jenkins Console Output as a post build step in the same job that creates this output. Redirecting logs with >> log.txt is not a solution since this is not supported by my build steps.

构建:

echo "This is log"

构建后步骤:

grep "is" path/to/console_output

文件系统中创建的具体日志文件在哪里?

Where is the specific log file created in filesystem?

推荐答案

@Bruno Lavit 有一个很好的答案,但如果您愿意,您只需访问日志并将其作为 txt 文件从作业的 URL 下载到您的工作区:

@Bruno Lavit has a great answer, but if you want you can just access the log and download it as txt file to your workspace from the job's URL:

${BUILD_URL}/consoleText

然后只需将此页面下载到您的${Workspace}

Then it's only a matter of downloading this page to your ${Workspace}

  • 您可以使用Invoke ANT"并使用 GET 目标
  • 在 Linux 上,您可以使用 wget 将其下载到您的工作区
  • You can use "Invoke ANT" and use the GET target
  • On Linux you can use wget to download it to your workspace
  • etc.

祝你好运!

文件系统上的实际日志文件不在从机上,而是保存在主机上.您可以在以下位置找到它:$JENKINS_HOME/jobs/$JOB_NAME/builds/lastSuccessfulBuild/log

The actual log file on the file system is not on the slave, but kept in the Master machine. You can find it under: $JENKINS_HOME/jobs/$JOB_NAME/builds/lastSuccessfulBuild/log

如果您正在寻找另一个构建,只需将 lastSuccessfulBuild 替换为您正在寻找的构建.

If you're looking for another build just replace lastSuccessfulBuild with the build you're looking for.

这篇关于詹金斯“控制台输出"文件系统中的日志位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆