mirror of
https://github.com/onepanelio/onepanel.git
synced 2024-08-21 00:00:34 +08:00
chore: updated contributing guide to include docker version
This commit is contained in:
parent
bd2d98c146
commit
779cba97c9
@ -1,5 +1,18 @@
|
|||||||
## Database migrations
|
## Database migrations
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
Note: Up migrations are automatically executed when the application is run.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm --mount type=bind,source="${PWD}",target=/root onepanel-helper:v1.0.0 goose -dir db/sql create <name> sql # Create migration in db/sql folder
|
||||||
|
docker run --rm --mount type=bind,source="${PWD}",target=/root onepanel-helper:v1.0.0 goose -dir db postgres "${DB_DATASOURCE_NAME}" up # Migrate the DB to the most recent version available
|
||||||
|
docker run --rm --mount type=bind,source="${PWD}",target=/root onepanel-helper:v1.0.0 goose -dir db postgres "${DB_DATASOURCE_NAME}" down # Roll back the version by 1
|
||||||
|
docker run --rm --mount type=bind,source="${PWD}",target=/root onepanel-helper:v1.0.0 goose help # See all available commands
|
||||||
|
```
|
||||||
|
|
||||||
|
### Local
|
||||||
|
|
||||||
Install `goose`:
|
Install `goose`:
|
||||||
```bash
|
```bash
|
||||||
go get -u github.com/pressly/goose/cmd/goose
|
go get -u github.com/pressly/goose/cmd/goose
|
||||||
@ -8,13 +21,15 @@ go get -u github.com/pressly/goose/cmd/goose
|
|||||||
Note: Up migrations are automatically executed when the application is run.
|
Note: Up migrations are automatically executed when the application is run.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
goose -dir db create <name> sql # Create migration in db folder
|
goose -dir db/sql create <name> sql # Create migration in db/sql folder
|
||||||
goose -dir db postgres "${DB_DATASOURCE_NAME}" up # Migrate the DB to the most recent version available
|
goose -dir db postgres "${DB_DATASOURCE_NAME}" up # Migrate the DB to the most recent version available
|
||||||
goose -dir db postgres "${DB_DATASOURCE_NAME}" down # Roll back the version by 1
|
goose -dir db postgres "${DB_DATASOURCE_NAME}" down # Roll back the version by 1
|
||||||
goose help # See all available commands
|
goose help # See all available commands
|
||||||
```
|
```
|
||||||
|
|
||||||
## gRPC installation
|
## gRPC
|
||||||
|
|
||||||
|
### local installation
|
||||||
|
|
||||||
Install gRPC:
|
Install gRPC:
|
||||||
```bash
|
```bash
|
||||||
@ -47,6 +62,15 @@ Make sure that your `$GOBIN` is in your `$PATH`.
|
|||||||
|
|
||||||
## API code generation
|
## API code generation
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
Generate Go and Swagger APIs:
|
||||||
|
```bash
|
||||||
|
docker run --rm --mount type=bind,source="${PWD}",target=/root onepanel-helper:v1.0.0 make api version=1.0.0
|
||||||
|
```
|
||||||
|
|
||||||
|
### Local Installation
|
||||||
|
|
||||||
Generate Go and Swagger APIs:
|
Generate Go and Swagger APIs:
|
||||||
```bash
|
```bash
|
||||||
make api version=1.0.0
|
make api version=1.0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user