From 75064a60560e2be8245a8464841510d24096a560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6nig?= Date: Thu, 3 Jul 2025 10:43:58 +0200 Subject: [PATCH 1/3] fix: support ferretdb v2 --- action.yml | 6 ------ start-ferretdb.sh | 38 +++++++++++++------------------------- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/action.yml b/action.yml index defd570..1a2925c 100644 --- a/action.yml +++ b/action.yml @@ -21,11 +21,6 @@ inputs: required: false default: "disabled" - use-postgres: - description: 'Configure FerretDB to use PostgreSQL (default "disabled")' - required: false - default: "false" - runs: using: "docker" image: "Dockerfile" @@ -33,4 +28,3 @@ runs: - ${{ inputs.ferretdb-version }} - ${{ inputs.ferretdb-port }} - ${{ inputs.ferretdb-telemetry }} - - ${{ inputs.use-postgres }} diff --git a/start-ferretdb.sh b/start-ferretdb.sh index 3a94ebb..05c8fbc 100644 --- a/start-ferretdb.sh +++ b/start-ferretdb.sh @@ -7,31 +7,19 @@ USE_POSTGRES=$4 echo "Starting FerretDB version ${FERRETDB_VERSION} on port ${FERRETDB_PORT}" -if [ "$USE_POSTGRES" = "true" ]; then - echo "Starting FerretDB with Postgres" - - docker network create ferretdb - - docker run --network ferretdb --name postgres \ - -e POSTGRES_USER=username \ - -e POSTGRES_PASSWORD=password \ - -e POSTGRES_DB=ferretdb \ - -d postgres - - docker run --network ferretdb --name ferretdb \ - -p $FERRETDB_PORT:27017 \ - -e FERRETDB_POSTGRESQL_URL=postgres://username:password@postgres:5432/ferretdb?pool_max_conns=40 \ - -e FERRETDB_TELEMETRY=$FERRETDB_TELEMETRY \ - -d ghcr.io/ferretdb/ferretdb:$FERRETDB_VERSION -else - echo "Starting FerretDB with sqlite" - - docker run --name ferretdb \ - -p $FERRETDB_PORT:27017 \ - -e FERRETDB_HANDLER=sqlite \ - -e FERRETDB_TELEMETRY=$FERRETDB_TELEMETRY \ - -d ghcr.io/ferretdb/ferretdb:$FERRETDB_VERSION -fi +docker network create ferretdb + +docker run --network ferretdb --name postgres \ + -e POSTGRES_USER=username \ + -e POSTGRES_PASSWORD=password \ + -e POSTGRES_DB=ferretdb \ + -d ghcr.io/ferretdb/postgres-documentdb:latest + +docker run --network ferretdb --name ferretdb \ + -p $FERRETDB_PORT:27017 \ + -e FERRETDB_POSTGRESQL_URL=postgres://username:password@postgres:5432/ferretdb?pool_max_conns=40 \ + -e FERRETDB_TELEMETRY=$FERRETDB_TELEMETRY \ + -d ghcr.io/ferretdb/ferretdb:$FERRETDB_VERSION if [ $? -ne 0 ]; then echo "Error starting FerretDB Docker container" From e076f0a80c12c2d6ff16666bb6d0f6b7582b42ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6nig?= Date: Thu, 3 Jul 2025 10:44:22 +0200 Subject: [PATCH 2/3] chore: empty commit From 5018da0780f3019d17bb0664ab0a593e46dfe12e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6nig?= Date: Thu, 3 Jul 2025 10:50:48 +0200 Subject: [PATCH 3/3] chore: remove postgres enabled action --- .github/workflows/main.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3aea7ff..9f42c77 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,24 +42,3 @@ jobs: - run: npm install - run: PORT=12345 npm test - - postgres-enabled: - name: Start FerretDB with Postgres - - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Start FerretDB - uses: ./ - with: - use-postgres: "true" - - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 - - - run: npm install - - run: npm test