Skip to content

Commit bf58867

Browse files
committed
Update makefile and documentation
1 parent f4e4ab3 commit bf58867

File tree

5 files changed

+47
-35
lines changed

5 files changed

+47
-35
lines changed

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
setup:
22
@docker build --progress=plain -f Containerfile -t mermerd .
33

4+
run: STORAGE_DIRECTORY = "$(CURDIR)/storage/"
45
run:
5-
@touch output.mmd
6-
@docker run --rm -it --net host \
7-
--mount type=bind,source="$(CURDIR)"/examples/mermerd-config.yaml,target=/root/.mermerd \
8-
--mount type=bind,source="$(CURDIR)"/output.mmd,target=/root/result.mmd \
6+
@docker run --rm -it \
7+
--net host \
8+
-v "$(STORAGE_DIRECTORY):/mnt/storage/" \
99
mermerd \
10-
--runConfig "/root/.mermerd" \
10+
--runConfig "/etc/mermerd/config.yml" \
1111
--connectionString "mysql://root:@tcp(host.docker.internal:3306)/mysql"
1212

1313
test:
14-
@$(MAKE) setup
15-
@tests/index.sh
14+
@$(CURDIR)/tests/index.sh

README.md

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,24 @@
1-
# [mermerd-container](https://github.com/nedix/mermerd-container)
1+
# [mermerd-container][project]
22

33
Create [Mermaid] ERD diagrams from live databases.
44

5-
## Usage
6-
7-
#### 1. Create an output file
8-
9-
```shell
10-
touch output.mmd
11-
```
125

13-
#### 2. (Optional) Create a mermerd configuration file
6+
## Usage
147

15-
See
16-
[documentation](https://github.com/KarnerTh/mermerd?tab=readme-ov-file#global-configuration-file)
17-
and
18-
[examples/mermerd-config.yaml](https://github.com/nedix/mermerd-container/blob/main/examples/mermerd-config.yaml)
19-
.
208

21-
#### 3. Run the mermerd command-line interface
9+
### 3. Run the mermerd command-line utility
2210

2311
This example command connects to a MySQL server running on localhost port 3306.
2412
Replace `root:` with your `username:password` combination.
2513

2614
```shell
27-
docker run --pull always --rm -it --name mermerd \
15+
docker run --rm -it --pull always --name mermerd \
2816
--net host \
29-
--mount type=bind,source="${PWD}"/output.mmd,target=/root/result.mmd \
30-
--mount type=bind,source="${PWD}"/mermerd-config.yaml,target=/root/.mermerd \ # optional
31-
nedix/mermerd \
17+
-v "${PWD}/storage/:/mnt/storage/" \
18+
mermerd \
19+
--runConfig "/etc/mermerd/config.yml" \
3220
--connectionString "mysql://root:@tcp(host.docker.internal:3306)/mysql"
3321
```
3422

35-
<hr>
36-
37-
## Attribution
38-
39-
Powered by [mermerd].
4023

41-
[mermaid]: https://mermaid.js.org
42-
[mermerd]: https://github.com/KarnerTh/mermerd
24+
[project]: https://hub.docker.com/r/nedix/mermerd

docs/make.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Make
2+
3+
## Available commands
4+
5+
### Setup
6+
7+
Build the container.
8+
9+
Command: `make setup`
10+
11+
12+
### Run
13+
14+
Start the container.
15+
16+
Command: `make run`
17+
18+
Options:
19+
20+
| Option key | Default value |
21+
|---------------------|----------------------------|
22+
| STORAGE_DIRECTORY | ./storage/ |
23+
24+
25+
### Test
26+
27+
Run all tests.
28+
29+
Command: `make test`

examples/mermerd-config.yaml renamed to rootfs/etc/mermerd/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ omitAttributeKeys: true
1010
# omit the constraint labels
1111
omitConstraintLabels: true
1212

13-
# output file name (default "result.mmd")
14-
outputFileName: "result.mmd"
13+
# output file name
14+
outputFileName: "/mnt/storage/output.mmd"
1515

1616
# schema that should be used
1717
schema:

storage/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)