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

Rails: rake db:structure:load times out on CircleCI 2.0

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

不幸的是,它似乎挂起但没有挂起 return:

$ 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)

Found someone else with the same issue on CircleCI,虽然没有答案。

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

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

(1 row)

(END)   <--- like from a terminal pager

不完全是一个合适的解决方案,但 .circleci/config.yml 中的解决方法:

jobs:
    build:
        docker:
          - image: MY_APP_IMAGE
            environment:
              PAGER: cat # prevent psql commands using less

运行 最近在 CircleCI 上使用 Postgres 11.14 进行了类似的操作。

这是关于它的主题:https://discuss.circleci.com/t/postgres-failing-with-upgrading-from-11-6-to-11-14/42932/2

基本上需要添加到圈子中的 Ruby 环境部分 CI config.yml:
PSQL_PAGER: ''

感谢@swrobel 的修复。