Add pg_dump to server dockerfile

This commit is contained in:
Adria Navarro 2023-06-22 11:13:20 +01:00
parent 6b049cbcda
commit a5ae0e5a3f
2 changed files with 17 additions and 4 deletions

View File

@ -18,7 +18,7 @@ ENV TOP_LEVEL_PATH=/
# handle node-gyp # handle node-gyp
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends g++ make python postgresql-client && apt-get install -y --no-install-recommends g++ make python
RUN yarn global add pm2 RUN yarn global add pm2
# Install client for oracle datasource # Install client for oracle datasource
@ -26,6 +26,16 @@ RUN apt-get install unzip libaio1
COPY scripts/integrations/oracle/ scripts/integrations/oracle/ COPY scripts/integrations/oracle/ scripts/integrations/oracle/
RUN /bin/bash -e scripts/integrations/oracle/instantclient/linux/x86-64/install.sh RUN /bin/bash -e scripts/integrations/oracle/instantclient/linux/x86-64/install.sh
# Add the PostgreSQL repository
RUN apt update && apt upgrade -y \
&& apt install software-properties-common apt-transport-https curl gpg -y \
&& curl -fsSl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/postgresql.gpg > /dev/null \
&& echo deb [arch=amd64,arm64,ppc64el signed-by=/usr/share/keyrings/postgresql.gpg] http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main | tee /etc/apt/sources.list.d/postgresql.list \
&& apt update -y \
&& apt install postgresql-client-15 -y \
&& apt remove software-properties-common apt-transport-https curl gpg -y
COPY package.json . COPY package.json .
COPY dist/yarn.lock . COPY dist/yarn.lock .
RUN yarn install --production=true RUN yarn install --production=true

View File

@ -229,10 +229,13 @@ describe("getExternalSchema", () => {
it("does not export a data", async () => { it("does not export a data", async () => {
const integration = new postgres.integration(config) const integration = new postgres.integration(config)
await integration.internalQuery({ await integration.internalQuery(
{
sql: `INSERT INTO "users" ("name", "role") VALUES ('John Doe', 'Administrator'); sql: `INSERT INTO "users" ("name", "role") VALUES ('John Doe', 'Administrator');
INSERT INTO "products" ("name", "price") VALUES ('Book', 7.68);`, INSERT INTO "products" ("name", "price") VALUES ('Book', 7.68);`,
}) },
false
)
const result = await integration.getExternalSchema() const result = await integration.getExternalSchema()
expect(result).toMatchInlineSnapshot(` expect(result).toMatchInlineSnapshot(`