Rails:rake db:structure:load 在 CircleCI 2.0 上超时

Kac*_*che 8 database postgresql ruby-on-rails circleci circleci-2.0

当前,rake db:schema:load运行以在 CircleCI 上设置数据库。在从 using 迁移schema.rb到 时structure.sql,命令已更新为:rake db:structure:load

不幸的是,它似乎挂起并且没有返回:

$ bin/rake db:structure:load --trace
** Invoke db:structure:load (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:structure:load
WARNING: terminal is not fully functional

 set_config 
------------

(1 row)

(END)rake aborted!
Interrupt:
<STACK TRACE>
bin/rake:9:in `<main>'
Tasks: TOP => db:structure:load
Too long with no output (exceeded 10m0s)
Run Code Online (Sandbox Code Playgroud)

在 CircleCI 上发现其他人有同样的问题,但没有答案。

Kac*_*che 12

这似乎与psql客户端向终端期望用户输入的输出有关:

 set_config 
------------

(1 row)

(END)   <--- like from a terminal pager
Run Code Online (Sandbox Code Playgroud)

不完全是正确的解决方案,而是一种解决方法.circleci/config.yml

jobs:
    build:
        docker:
          - image: MY_APP_IMAGE
            environment:
              PAGER: cat # prevent psql commands using less
Run Code Online (Sandbox Code Playgroud)

  • 类似的方法通过 semaphoreci 为我解决了这个问题 (2认同)