Skip to content

Commit

Permalink
Add setup make target
Browse files Browse the repository at this point in the history
The goal is to have one command to get everything ready to run.
  • Loading branch information
wcalderipe committed Jan 5, 2024
1 parent 69a6560 commit 5c04b73
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
include ./apps/orchestration/Makefile
include ./apps/authz-node/Makefile

# For more terminal color codes, head over to https://opensource.com/article/19/9/linux-terminal-colors
TERM_NO_COLOR := \033[0m
TERM_GREEN := \033[0;32m

install:
npm install

install/ci:
npm ci

setup:
make install
make docker/up
make orchestration/setup
make authz/setup
@echo ""
@echo "${TERM_GREEN}Orchestration & AuthZ applications are ready 🐋${TERM_NO_COLOR}"
@echo "${TERM_GREEN}Run 'make orchestration/start/dev' or/and 'make authz/start/dev' to get them running.${TERM_NO_COLOR}"

docker/stop:
docker-compose stop

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@

TBD

## Getting started

To setup the project, run the following command:

```bash
make setup
```

At the end, you must have a working environment ready to run any application.

## Application

- [AuthZ](./apps/authz-node/README.md)
Expand Down
3 changes: 3 additions & 0 deletions apps/authz-node/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
AUTHZ_PROJECT_NAME := apps/authz-node
AUTHZ_PROJECT_DIR := ./apps/authz-node

authz/setup:
make authz/copy-default-env

authz/start/dev:
npx nx serve ${AUTHZ_PROJECT_NAME}

Expand Down
5 changes: 5 additions & 0 deletions apps/orchestration/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ ORCHESTRATION_DATABASE_SCHEMA := ${ORCHESTRATION_PROJECT_DIR}/src/persistence/sc
orchestration/start/dev:
npx nx serve ${ORCHESTRATION_PROJECT_NAME}

orchestration/setup:
make orchestration/copy-default-env
make orchestration/db/migrate
make orchestration/test/db/setup

orchestration/copy-default-env:
cp ${ORCHESTRATION_PROJECT_DIR}/.env.default ${ORCHESTRATION_PROJECT_DIR}/.env
cp ${ORCHESTRATION_PROJECT_DIR}/.env.test.default ${ORCHESTRATION_PROJECT_DIR}/.env.test
Expand Down

0 comments on commit 5c04b73

Please sign in to comment.