Skip to content

Commit

Permalink
Chore(OGCIO): makefile run native (#70)
Browse files Browse the repository at this point in the history
* chore(core): added run native command

* chore(core): re-added old docs

* chore(core): added EOF
  • Loading branch information
SamSalvatico authored Jul 8, 2024
1 parent 27210ae commit e00a1ff
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
18 changes: 11 additions & 7 deletions README.OGCIO.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,36 @@ PORT=3301
USER_DEFAULT_ORGANIZATION_NAMES=OGCIO Seeded Org
USER_DEFAULT_ORGANIZATION_ROLE_NAMES=OGCIO Employee, OGCIO Manager
```
2. Run the makefile command
```
make run-native
```

2. Install all the dependencies. Please also refer to the [original guide](.github/CONTRIBUTING.md) when building the project.
It runs, under the hood, all the following commands:

1. Install all the dependencies. Please also refer to the [original guide](.github/CONTRIBUTING.md) when building the project.

`pnpm pnpm:devPreinstall && pnpm i && pnpm prepack`

3. After the installation, you can start seeding the database. You have to seed in two steps:
2. After the installation, you can start seeding the database. You have to seed in two steps:
- seed Logto's database: `pnpm cli db seed`
- seed custom OGCIO data: `npm run cli db ogcio -- --seeder-filepath="./packages/cli/src/commands/database/ogcio/ogcio-seeder-local.json"`

3.5. Database alteration
2.5. Database alteration

If you are upgrading your dev environment from an older version, or facing the `Found undeployed database alterations...` error when starting Logto, you need to deploy the database alteration first.

Run `pnpm alteration deploy` and start Logto again. See [Database alteration](https://docs.logto.io/docs/tutorials/using-cli/database-alteration) for reference of this command.

If you are developing something with database alterations, see [packages/schemas/alteration](https://github.com/logto-io/logto/tree/master/packages/schemas/alterations) to learn more.

4. After the seeding of the database was finished, the connectors must be built and linked to the system:
3. After the seeding of the database was finished, the connectors must be built and linked to the system:

- `pnpm connectors build`

- `pnpm cli connector link`

### Starting Logto

The local Logto instance can be started by running the following command:
4. The local Logto instance can be started by running the following command:

`pnpm dev`

Expand Down
20 changes: 18 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# This file has been added on OGCIO fork
TAG = local-logto:latest
GREEN=\033[0;32m
NC=\033[0m

build:
docker build -t ${TAG} .
run:
docker-compose -f docker-compose-local.yml up --detach

down:
docker-compose -f docker-compose-local.yml down
docker-compose -f docker-compose-local.yml down
run-native:
@echo "${GREEN}Starting db...${NC}"
docker compose -f docker-compose-db.yml up --detach
@echo "${GREEN}Db started!${NC}"
@echo "${GREEN}Installing stuffs...${NC}"
pnpm pnpm:devPreinstall && pnpm i && pnpm prepack
@echo "${GREEN}Stuffs installed!${NC}"
@echo "${GREEN}Seeding db...${NC}"
npm run cli db seed -- --swe && npm run cli db alteration deploy latest && npm run cli db ogcio -- --seeder-filepath="./packages/cli/src/commands/database/ogcio/ogcio-seeder-local.json"
@echo "${GREEN}Db ready!${NC}"
@echo "${GREEN}Preparing connectors...${NC}"
pnpm connectors build && pnpm cli connector link
@echo "${GREEN}Connectors ready!${NC}"
@echo "${GREEN}Starting Logto...${NC}"
pnpm dev

0 comments on commit e00a1ff

Please sign in to comment.