From 2befd0ff147f73f8690b48e06e8dfadf97ea5e67 Mon Sep 17 00:00:00 2001
From: Shiv Tyagi <67995771+shiv-tyagi@users.noreply.github.com>
Date: Sun, 12 Nov 2023 14:56:12 +0530
Subject: [PATCH] infra: add make commands for provisioning postgres in macos
and linux (#2436)
* infra: add make commands for provisioning postgres in macos and linux
* docs: update commands for provisioning postgres on linux and macos
---
docs/docs/contributor/local-setup/yarn-setup.mdx | 8 ++++----
infra/dev/Makefile | 8 +++++++-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/docs/docs/contributor/local-setup/yarn-setup.mdx b/docs/docs/contributor/local-setup/yarn-setup.mdx
index 29ebf693b..edcf3012f 100644
--- a/docs/docs/contributor/local-setup/yarn-setup.mdx
+++ b/docs/docs/contributor/local-setup/yarn-setup.mdx
@@ -106,7 +106,7 @@ You need to provision this database with a `twenty` user (password: `twenty`), a
```bash
cd twenty
-./infra/dev/scripts/setup-postgres-linux.sh
+make provision-postgres-linux
```
Option 2: If you have docker installed:
@@ -114,7 +114,7 @@ cd twenty
```bash
cd twenty
-make provision-postgres
+make provision-postgres-docker
```
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
You can access this using `twenty` postgres user (password: `twenty`)
@@ -126,7 +126,7 @@ You can access this using `twenty` postgres user (password: `twenty`)
```bash
cd twenty
-./infra/dev/scripts/setup-postgres-macos.sh
+make provision-postgres-macos
```
Option 2: If you have docker installed:
@@ -134,7 +134,7 @@ cd twenty
```bash
cd twenty
-make provision-postgres
+make provision-postgres-docker
```
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
You can access this using `twenty` postgres user (password: `twenty`)
diff --git a/infra/dev/Makefile b/infra/dev/Makefile
index 24af35c9c..1a6aa7718 100644
--- a/infra/dev/Makefile
+++ b/infra/dev/Makefile
@@ -8,12 +8,18 @@ build:
@docker volume rm twenty_node_modules_docs > /dev/null 2>&1 || true
@docker compose build
-provision-postgres:
+provision-postgres-docker:
@docker stop twenty_postgres || true
@docker rm twenty_postgres || true
@docker volume rm twenty_db_data || true
@docker compose up --build postgres -d
+provision-postgres-macos:
+ sh ./scripts/setup-postgres-macos.sh
+
+provision-postgres-linux:
+ sh ./scripts/setup-postgres-linux.sh
+
up:
@docker compose up -d