CI(build-tools): don't install Postgres 14 (#6540)

## Problem

We install Postgres 14 in `build-tools` image, but we don't need
it. We use Postgres binaries, which we build ourselves.

## Summary of changes
- Remove Postgresql 14 installation from `build-tools` image
This commit is contained in:
Alexander Bayandin
2024-06-26 16:37:04 +01:00
committed by GitHub
parent d7e349d33c
commit 5af9660b9e
2 changed files with 9 additions and 9 deletions

View File

@@ -73,13 +73,6 @@ RUN curl -fsSL 'https://apt.llvm.org/llvm-snapshot.gpg.key' | apt-key add - \
&& bash -c 'for f in /usr/bin/clang*-${LLVM_VERSION} /usr/bin/llvm*-${LLVM_VERSION}; do ln -s "${f}" "${f%-${LLVM_VERSION}}"; done' \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# PostgreSQL 14
RUN curl -fsSL 'https://www.postgresql.org/media/keys/ACCC4CF8.asc' | apt-key add - \
&& echo 'deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
&& apt update \
&& apt install -y postgresql-client-14 \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" \
&& unzip -q awscliv2.zip \

View File

@@ -3075,9 +3075,16 @@ class PSQL:
host: str = "127.0.0.1",
port: int = 5432,
):
assert shutil.which(path)
search_path = None
if (d := os.getenv("POSTGRES_DISTRIB_DIR")) is not None and (
v := os.getenv("DEFAULT_PG_VERSION")
) is not None:
search_path = Path(d) / f"v{v}" / "bin"
self.path = path
full_path = shutil.which(path, path=search_path)
assert full_path is not None
self.path = full_path
self.database_url = f"postgres://{host}:{port}/main?options=project%3Dgeneric-project-name"
async def run(self, query: Optional[str] = None) -> asyncio.subprocess.Process: