mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
Add automated script for extension packaging. The script enables packaging and testing for all combinations of `[Debian 12, Debian 11, Ubuntu 24.04, Ubuntu 22.04, Ubuntu 20.04] x [PG 16, PG 15]`
82 lines
2.6 KiB
Plaintext
82 lines
2.6 KiB
Plaintext
ARG BASE_IMAGE=debian:bookworm
|
|
FROM ${BASE_IMAGE}
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG POSTGRES_VERSION=16
|
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get install -y --no-install-recommends \
|
|
wget \
|
|
gnupg2 \
|
|
lsb-release \
|
|
ca-certificates \
|
|
locales
|
|
|
|
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
|
|
locale-gen en_US.UTF-8
|
|
|
|
ENV LC_ALL=en_US.UTF-8
|
|
ENV LANGUAGE=en_US
|
|
ENV LC_COLLATE=en_US.UTF-8
|
|
ENV LC_CTYPE=en_US.UTF-8
|
|
ENV LANG=en_US.UTF-8
|
|
|
|
RUN echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main ${POSTGRES_VERSION}" > /etc/apt/sources.list.d/pgdg.list && \
|
|
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
tzdata \
|
|
build-essential \
|
|
pkg-config \
|
|
cmake \
|
|
git \
|
|
postgresql-${POSTGRES_VERSION} \
|
|
postgresql-server-dev-${POSTGRES_VERSION} \
|
|
libpq-dev \
|
|
libicu-dev \
|
|
libkrb5-dev \
|
|
postgresql-${POSTGRES_VERSION}-cron \
|
|
postgresql-${POSTGRES_VERSION}-pgvector \
|
|
postgresql-${POSTGRES_VERSION}-postgis-3 \
|
|
postgresql-${POSTGRES_VERSION}-rum \
|
|
devscripts \
|
|
debhelper \
|
|
dpkg-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY scripts /tmp/install_setup
|
|
|
|
RUN CLEAN_SETUP=1 INSTALL_DEPENDENCIES_ROOT=/tmp/install_setup /tmp/install_setup/install_setup_pcre2.sh
|
|
RUN CLEAN_SETUP=1 INSTALL_DEPENDENCIES_ROOT=/tmp/install_setup /tmp/install_setup/install_setup_intel_decimal_math_lib.sh
|
|
RUN CLEAN_SETUP=1 INSTALL_DEPENDENCIES_ROOT=/tmp/install_setup /tmp/install_setup/install_citus_indent.sh
|
|
|
|
RUN export CLEAN_SETUP=1 && \
|
|
export INSTALL_DEPENDENCIES_ROOT=/tmp/install_setup && \
|
|
MAKE_PROGRAM=cmake /tmp/install_setup/install_setup_libbson.sh && \
|
|
/tmp/install_setup/install_setup_pcre2.sh && \
|
|
/tmp/install_setup/install_setup_intel_decimal_math_lib.sh && \
|
|
/tmp/install_setup/install_citus_indent.sh
|
|
|
|
# Set the working directory inside the container
|
|
WORKDIR /build
|
|
|
|
# Copy the source code into the container
|
|
COPY . /build
|
|
|
|
RUN grep -E "^default_version" pg_helio_core/pg_helio_core.control | sed -E "s/.*'([0-9]+\.[0-9]+-[0-9]+)'.*/\1/" > HELIODB_VERSION
|
|
|
|
# Convert the version to the format expected by the debian packaging
|
|
RUN sed -i "s/-/\./g" HELIODB_VERSION
|
|
|
|
# Setup the debian packaging
|
|
COPY packaging/debian_files /build/debian
|
|
RUN sed -i "s/POSTGRES_VERSION/${POSTGRES_VERSION}/g" /build/debian/control
|
|
RUN sed -i "s/HELIODB_VERSION/$(cat HELIODB_VERSION)/g" /build/debian/changelog
|
|
|
|
COPY packaging/packaging-entrypoint.sh /usr/local/bin/packaging-entrypoint.sh
|
|
|
|
# Set the entrypoint
|
|
ENTRYPOINT ["packaging-entrypoint.sh"]
|