Add pg_dump to single dockerfile
This commit is contained in:
parent
a5ae0e5a3f
commit
55e38725db
|
@ -37,6 +37,14 @@ COPY --from=build /worker /worker
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends software-properties-common nginx uuid-runtime redis-server
|
apt-get install -y --no-install-recommends software-properties-common nginx uuid-runtime redis-server
|
||||||
|
|
||||||
|
# Install postgres client for pg_dump utils
|
||||||
|
RUN apt install software-properties-common apt-transport-https 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 gpg -y
|
||||||
|
|
||||||
# install other dependencies, nodejs, oracle requirements, jdk8, redis, nginx
|
# install other dependencies, nodejs, oracle requirements, jdk8, redis, nginx
|
||||||
WORKDIR /nodejs
|
WORKDIR /nodejs
|
||||||
RUN curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh && \
|
RUN curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh && \
|
||||||
|
|
|
@ -26,7 +26,7 @@ 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
|
# Install postgres client for pg_dump utils
|
||||||
RUN apt update && apt upgrade -y \
|
RUN apt update && apt upgrade -y \
|
||||||
&& apt install software-properties-common apt-transport-https curl gpg -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 \
|
&& curl -fsSl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/postgresql.gpg > /dev/null \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { GenericContainer, StartedTestContainer } from "testcontainers"
|
import { GenericContainer } from "testcontainers"
|
||||||
import postgres from "../../../../packages/server/src/integrations/postgres"
|
import postgres from "../../../../packages/server/src/integrations/postgres"
|
||||||
|
|
||||||
jest.unmock("pg")
|
jest.unmock("pg")
|
||||||
|
@ -6,10 +6,9 @@ jest.unmock("pg")
|
||||||
describe("getExternalSchema", () => {
|
describe("getExternalSchema", () => {
|
||||||
describe("postgres", () => {
|
describe("postgres", () => {
|
||||||
let config: any
|
let config: any
|
||||||
let container: StartedTestContainer
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
container = await new GenericContainer("postgres")
|
const container = await new GenericContainer("postgres")
|
||||||
.withExposedPorts(5432)
|
.withExposedPorts(5432)
|
||||||
.withEnv("POSTGRES_PASSWORD", "password")
|
.withEnv("POSTGRES_PASSWORD", "password")
|
||||||
.start()
|
.start()
|
||||||
|
@ -29,8 +28,6 @@ describe("getExternalSchema", () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(() => container.stop())
|
|
||||||
|
|
||||||
it("can export an empty database", async () => {
|
it("can export an empty database", async () => {
|
||||||
const integration = new postgres.integration(config)
|
const integration = new postgres.integration(config)
|
||||||
const result = await integration.getExternalSchema()
|
const result = await integration.getExternalSchema()
|
||||||
|
|
Loading…
Reference in New Issue