在 TravisCI 中将 PostgreSQL 版本更新至 13

发布于 2025-01-12 13:32:16 字数 1019 浏览 2 评论 0原文

当我尝试在拉取请求进行一些更改时测试代码时,我遇到了 TravisCI 平台的一些问题。到目前为止它工作正常,但现在当我运行 travis_apt_get_update 命令时,我在构建运行日志中收到此警告:

PostgreSQL 版本 9.4 已过时,但服务器或客户端软件包 仍然安装。请安装最新的软件包(postgresql-13 和 postgresql-client-13) 并升级现有集群 pg_upgradecluster(请参阅联机帮助页)。

我已经添加了 postgresql-13postgresql-client-13 包,这里是 .travis.yml 文件:

language: perl
perl:
  - "5.30"
dist: xenial
env:
  - HOST_URL="localhost"
cache:
  directories:
    - $HOME/path/to/local
services:
  - postgresql
addons:
  postgresql: 13
  apt:
    packages:
    - postgresql-13
    - postgresql-client-13
    - libpq-dev
    - build-essential
    - libssl-dev
    - zlib1g-dev
    - clang-tidy
env:
  global:
    - PGPORT=5433
before_install:
  - wget http://mirrors.kernel.org/ubuntu/pool/universe/a/astyle/astyle_3.1-1ubuntu2_amd64.deb
  - sudo dpkg -i astyle_3.1-1ubuntu2_amd64.deb
  - sudo chmod -R 777 /var/log/

现在,在日志中它说我必须使用 pg_upgradecluster 升级集群,但我真的不知道这意味着什么。

I have some issues with the TravisCI platform when I try to test the code when Pull Requesting some changes. It works fine so far, but now I get this warning in the build-run log when I run the travis_apt_get_update command:

The PostgreSQL version 9.4 is obsolete, but the server or client packages
are still installed. Please install the latest packages (postgresql-13 and
postgresql-client-13) and upgrade the existing clusters with
pg_upgradecluster (see manpage).

I have added the postgresql-13 and postgresql-client-13 packages, here is the .travis.yml file:

language: perl
perl:
  - "5.30"
dist: xenial
env:
  - HOST_URL="localhost"
cache:
  directories:
    - $HOME/path/to/local
services:
  - postgresql
addons:
  postgresql: 13
  apt:
    packages:
    - postgresql-13
    - postgresql-client-13
    - libpq-dev
    - build-essential
    - libssl-dev
    - zlib1g-dev
    - clang-tidy
env:
  global:
    - PGPORT=5433
before_install:
  - wget http://mirrors.kernel.org/ubuntu/pool/universe/a/astyle/astyle_3.1-1ubuntu2_amd64.deb
  - sudo dpkg -i astyle_3.1-1ubuntu2_amd64.deb
  - sudo chmod -R 777 /var/log/

Now, in the log it says that I have to upgrade the clusters with pg_upgradecluster, but I really don't know what that means.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七七 2025-01-19 13:32:17

此示例 (.travis.yml) 展示了如何在 Ubuntu 作业中运行 Postgres13。您可以在设置中配置/添加其他配置,看看是否有帮助。

---
dist: focal
language: ruby

addons:
  postgresql: '13'
  apt:
      packages:
        - postgresql-13
env:
  global:
   - PGUSER=postgres
   - PGPORT=5432
   - PGHOST=localhost
before_install:
 - sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
 - sudo service postgresql restart
 - sleep 1
 - postgres --version

script:
  - psql -c 'create database travis_ci_test;' -U postgres

如果您还有其他问题,请告诉我。

谢谢。

This example (.travis.yml) shows how to run Postgres13 within your Ubuntu jobs. You can configure/add additional configuration as your setup and see if that helps.

---
dist: focal
language: ruby

addons:
  postgresql: '13'
  apt:
      packages:
        - postgresql-13
env:
  global:
   - PGUSER=postgres
   - PGPORT=5432
   - PGHOST=localhost
before_install:
 - sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
 - sudo service postgresql restart
 - sleep 1
 - postgres --version

script:
  - psql -c 'create database travis_ci_test;' -U postgres

Let me know if you have further questions.

Thanks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文