5

我有一个使用 cpanm 安装一堆 Perl 模块的 BitBucket Pipeline。其中一个失败了,这是我可以在日志中看到的片段:

Fetching http://www.cpan.org/authors/id/P/PE/PETDANCE/ack-v3.0.2.tar.gz ... OK
Configuring ack-v3.0.2 ... OK
==> Found dependencies: File::Next
--> Working on File::Next
Fetching http://www.cpan.org/authors/id/P/PE/PETDANCE/File-Next-1.16.tar.gz ... OK
Configuring File-Next-1.16 ... OK
Building and testing File-Next-1.16 ... OK
Successfully installed File-Next-1.16
! Installing App::Ack failed. See /root/.cpanm/work/1562605191.55/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'App::Ack' is not installed
! Bailing out the installation for ..
Building and testing ack-v3.0.2 ... FAIL

如何访问安装过程创建的 build.log?

4

1 回答 1

3

显然最近 Bitbucket 添加了一个名为“后脚本”的功能,因此我可以添加以下内容并打印日志文件的内容。

       after-script:
          - ls -1 /root/.cpanm/work/*/build.log | xargs cat

甚至可能是这样:

       after-script:
          - cat /root/.cpanm/work/*/build.log

我认为,如果构建失败,以下内容只会显示日志文件的内容:

       after-script:
          - $BITBUCKET_EXIT_CODE && cat /root/.cpanm/work/*/build.log

在此处阅读更多信息:https ://bitbucket.org/blog/after-scripts-now-available-for-bitbucket-pipelines

于 2019-07-23T19:30:49.663 回答