3

我曾经为 codeship 和 npm 使用自定义构建、测试和部署脚本。现在转向 yarn,我想继续使用 codeship。但是,它总是yarn在 10 分钟后超时。

脚本的相关部分是:

nvm install 6.3.1
npm install yarn
yarn

这会产生:

yarn install v0.18.1
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.0.15: The platform "linux" is incompatible with this module.
info "fsevents@1.0.15" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning Incorrect peer dependency "joi@^9.0.4".
[4/4] Building fresh packages...

--------------------------------------------------------------------------------
This command didn't output anything for 10 minutes, thus we stopped it.
Please make sure your steps regularly print to standard out or standard error.
If the error is on our end please inform us so we can help you to fix this.
--------------------------------------------------------------------------------

两者(纱线和代码)不兼容吗?

4

1 回答 1

2

@simon 解决 - 将这些牵引线添加到Setup Commands部分:

function prevent_codeship_timeout() { ( for i in {1..5}; do echo "Preventing Codeship timeout by echoing every 300 seconds"; sleep 300; done ) & local pid=$!; trap 'kill ${pid}' SIGINT SIGTERM EXIT; }
prevent_codeship_timeout &

通过在 Codeship 支持中解决这个问题,Joe Siewert 帮助解决了这个问题:

为此,我建议将此脚本添加为构建步骤,然后在后台立即调用它。这只会定期打印一些日志输出以保持构建运行。它将运行固定次数,因此您可能需要根据构建步骤运行的时间增加/减少迭代次数({1..5} 部分)

请注意,将整个函数作为单行粘贴到构建步骤中很重要,否则将无法正确读取

感谢您的帮助乔 Siewert!

于 2020-02-21T18:36:13.017 回答