步骤 8:查看详细的构建信息 - Amazon CodeBuild
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

步骤 8:查看详细的构建信息

(上一步:步骤 7:查看汇总的构建信息

在此步骤中,您将在 Logs 中查看有关构建版本的 CloudWatch 详细信息。

注意

为了保护敏感信息, CodeBuild 日志中隐藏了以下内容:

查看详细的构建信息
  1. 使用您的 Web 浏览器,转到上一步的输出中显示的 deepLink 位置(如 https://console.aws.amazon.com/cloudwatch/home?region=region-ID#logEvent:group=/aws/codebuild/codebuild-demo-project;stream=38ca1c4a-e9ca-4dbc-bef1-d52bfEXAMPLE)。

  2. 在 CloudWatch 日志日志流中,您可以浏览日志事件。默认情况下,只显示最近的一组日志事件。要查看以前的日志事件,请滚动到列表开头。

  3. 在本教程中,大多数日志事件包含的是关于 CodeBuild 下载构建相关文件并将其安装到构建环境中的详细信息,您可能并不关心这些信息。您可以使用筛选事件框来减少显示的信息。例如,如果您在筛选事件中输入 "[INFO]",则仅显示那些包含 [INFO] 的事件。有关更多信息,请参阅 Amazon CloudWatch 用户指南中的筛选条件和模式语法

CloudWatch 日志流的这些部分与本教程有关。

... [Container] 2016/04/15 17:49:42 Entering phase PRE_BUILD [Container] 2016/04/15 17:49:42 Running command echo Entering pre_build phase... [Container] 2016/04/15 17:49:42 Entering pre_build phase... [Container] 2016/04/15 17:49:42 Phase complete: PRE_BUILD Success: true [Container] 2016/04/15 17:49:42 Entering phase BUILD [Container] 2016/04/15 17:49:42 Running command echo Entering build phase... [Container] 2016/04/15 17:49:42 Entering build phase... [Container] 2016/04/15 17:49:42 Running command mvn install [Container] 2016/04/15 17:49:44 [INFO] Scanning for projects... [Container] 2016/04/15 17:49:44 [INFO] [Container] 2016/04/15 17:49:44 [INFO] ------------------------------------------------------------------------ [Container] 2016/04/15 17:49:44 [INFO] Building Message Utility Java Sample App 1.0 [Container] 2016/04/15 17:49:44 [INFO] ------------------------------------------------------------------------ ... [Container] 2016/04/15 17:49:55 ------------------------------------------------------- [Container] 2016/04/15 17:49:55 T E S T S [Container] 2016/04/15 17:49:55 ------------------------------------------------------- [Container] 2016/04/15 17:49:55 Running TestMessageUtil [Container] 2016/04/15 17:49:55 Inside testSalutationMessage() [Container] 2016/04/15 17:49:55 Hi!Robert [Container] 2016/04/15 17:49:55 Inside testPrintMessage() [Container] 2016/04/15 17:49:55 Robert [Container] 2016/04/15 17:49:55 Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.018 sec [Container] 2016/04/15 17:49:55 [Container] 2016/04/15 17:49:55 Results : [Container] 2016/04/15 17:49:55 [Container] 2016/04/15 17:49:55 Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 ... [Container] 2016/04/15 17:49:56 [INFO] ------------------------------------------------------------------------ [Container] 2016/04/15 17:49:56 [INFO] BUILD SUCCESS [Container] 2016/04/15 17:49:56 [INFO] ------------------------------------------------------------------------ [Container] 2016/04/15 17:49:56 [INFO] Total time: 11.845 s [Container] 2016/04/15 17:49:56 [INFO] Finished at: 2016-04-15T17:49:56+00:00 [Container] 2016/04/15 17:49:56 [INFO] Final Memory: 18M/216M [Container] 2016/04/15 17:49:56 [INFO] ------------------------------------------------------------------------ [Container] 2016/04/15 17:49:56 Phase complete: BUILD Success: true [Container] 2016/04/15 17:49:56 Entering phase POST_BUILD [Container] 2016/04/15 17:49:56 Running command echo Entering post_build phase... [Container] 2016/04/15 17:49:56 Entering post_build phase... [Container] 2016/04/15 17:49:56 Phase complete: POST_BUILD Success: true [Container] 2016/04/15 17:49:57 Preparing to copy artifacts [Container] 2016/04/15 17:49:57 Assembling file list [Container] 2016/04/15 17:49:57 Expanding target/messageUtil-1.0.jar [Container] 2016/04/15 17:49:57 Found target/messageUtil-1.0.jar [Container] 2016/04/15 17:49:57 Creating zip artifact

在此示例中, CodeBuild 成功完成了预构建、生成和生成后的构建阶段。它运行单元测试并成功构建 messageUtil-1.0.jar 文件。

后续步骤

步骤 9:获取构建输出构件