Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@ inputs:
required: false
default: "disabled"

use-postgres:
description: 'Configure FerretDB to use PostgreSQL (default "disabled")'
required: false
default: "false"

runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.ferretdb-version }}
- ${{ inputs.ferretdb-port }}
- ${{ inputs.ferretdb-telemetry }}
- ${{ inputs.use-postgres }}
38 changes: 13 additions & 25 deletions start-ferretdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down