Skip to content

Commit

Permalink
Post-facade fixes (#306)
Browse files Browse the repository at this point in the history
* Fix supervisor "client stopped" task

* Other fixes
  • Loading branch information
florimondmanca authored Nov 18, 2022
1 parent c2ec95e commit 074a9bf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,20 @@ start-client-legacy-tailwind:
start-client-kit: ## Run SvelteKit client
PORT=${client_kit_port} ${run_client_kit} "cd client/kit && npm run dev"

compose: ## Run Docker compose command (args: CMD)
${compose} ${CMD}

compose-up: ## Start containers
${compose} up -d
make compose CMD="up -d"

compose-stop: ## Stop containers
${compose} stop
make compose CMD=stop

compose-rm: stop-containers ## Stop and remove containers
${compose} rm
compose-rm: compose-stop ## Stop and remove containers
make compose CMD=rm

compose-ps: ## Show running containers
${compose} ps
make compose CMD=ps

build: build-api build-client ## Build API and client

Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Permacoop is an open source and eco design ERP solution reserved for worker-owne

You must have **[PostgreSQL](https://www.postgresql.org/)** installed, or **[Docker](https://www.docker.com/)** and **[Docker Compose](https://docs.docker.com/compose/)** to run PostgreSQL using the provided `docker-compose.yml`.

Ensure you have [Node.js](https://nodejs.org) v16 and `node-gyp` installed globally (`npm install -g node-gyp`).
Ensure you have [Node.js](https://nodejs.org) **16.x** and `node-gyp` installed globally (`npm install -g node-gyp`).

## Quickstart

Expand All @@ -35,21 +35,16 @@ First, install dependencies:
make install
```

Then ensure your database is running:

* Start the PostgreSQL Docker container using `make database-start`. You can later stop it with `make database-stop`.
* If you are using a PostgreSQL database on your host, edit `server/ormconfig.json` to fit your setup.

You can now run database migrations:
Then start the database and other services:

```
make database-migrate
make compose-up
```

Finally, run an initial build:
You can now run database migrations:

```
make build
make database-migrate
```

You can now start the application using:
Expand All @@ -63,9 +58,10 @@ The server and client will be started:
- API documentation available on <http://localhost:3000/api>
- Client available on <http://localhost:3001/>

To serve the built server and client locally, run `$ make build`, then:
To serve the built server and client locally, run:

```
make build
make start-dist
```

Expand All @@ -81,6 +77,12 @@ For E2E tests, you will need to install additional dependencies first:
make install-client-e2e
```

Run E2E tests using:

```
make test-client-e2e
```

To run automatic code formatting, run:

```
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/web/tasks/supervisor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
become: true
notify: reload nginx

# Drop 'client' process from before client facade
# Drop 'client' process which ran before implementing sapper/sveltekit facade
- name: Ensure client is stopped
supervisorctl: name=client state=absent
supervisorctl: name=client state=stopped
become: true
notify: reload nginx

Expand Down

0 comments on commit 074a9bf

Please sign in to comment.