Skip to content

Commit d813b78

Browse files
authored
add guide for setup start up environment (#28)
1. add guide for setup start up environment 2. unify project name to START-DB
1 parent f4fdb61 commit d813b78

File tree

5 files changed

+48
-8
lines changed

5 files changed

+48
-8
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ target
2727
# idea ignore
2828
.idea
2929
*.iml
30+
31+
# generated file
32+
**/dependency-reduced-pom.xml

CONTRIBUTING.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,48 @@
1-
# Contributing to Start DB
1+
# Contributing to START-DB
2+
3+
### Running environment setup
4+
5+
Running environment need to be setup before build or test START-DB.
6+
7+
Please follow [Docker Setup](docker/docker-compose.md) and confirm
8+
9+
```
10+
mvn clean package
11+
```
12+
13+
run successfully.
214

315
### Importing the project into IntelliJ IDEA
4-
Start DB builds using Java 8. When importing into IntelliJ you will need
16+
17+
START-DB builds using Java 8. When importing into IntelliJ you will need
518
to define an appropriate SDK.or more details
619
on defining an SDK in IntelliJ please refer to [their documentation](https://www.jetbrains.com/help/idea/sdk.html#define-sdk).
720

8-
You can import the Start DB project into IntelliJ IDEA via:
21+
You can import the START-DB project into IntelliJ IDEA via:
922

1023
- Select **File > Open**
1124
- In the subsequent dialog navigate to the root `pom.xml` file
1225
- In the subsequent dialog select **Open as Project**
1326

1427
#### Checkstyle
15-
You can install [Checkstyle] plugin to check the Start DB code.
28+
29+
You can install [Checkstyle] plugin to check the START-DB code.
1630

1731
1. Open **File > Settings> Tools > CheckStyle**
1832
2. Select CheckStyle version `9.3`
1933
3. Import CheckStyle file `conventions/checkstyle.xml`
2034
4. Click "OK"
2135

2236
### Formatting
23-
Start DB code is automatically formatted with [spotless], backed by the Eclipse formatter. You can do the same in IntelliJ with the [Eclipse Code Formatter] so that you can apply the correct formatting directly in
37+
38+
START-DB code is automatically formatted with [spotless], backed by the Eclipse formatter. You can do the same in IntelliJ with the [Eclipse Code Formatter] so that you can apply the correct formatting directly in
2439
your IDE. Or import it as IntelliJ code style setting.
2540

2641
1. Open **File > Settings/Preferences > Code Style > Java**
2742
2. Gear icon > Import Scheme > Eclipse XML Profile
2843
3. Navigate to the file `conventions/eclipse-formatter.xml`
2944
4. Click "OK"
3045

31-
[Checkstyle]: https://plugins.jetbrains.com/plugin/1065-checkstyle-idea
46+
[checkstyle]: https://plugins.jetbrains.com/plugin/1065-checkstyle-idea
3247
[spotless]: https://github.com/diffplug/spotless
33-
[Eclipse Code Formatter]: https://plugins.jetbrains.com/plugin/6546-eclipse-code-formatter
48+
[eclipse code formatter]: https://plugins.jetbrains.com/plugin/6546-eclipse-code-formatter

conventions/eclipse-formatter.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<profiles version="13">
3-
<profile kind="CodeFormatterProfile" name="'Start DB Style'" version="13">
3+
<profile kind="CodeFormatterProfile" name="'START-DB Style'" version="13">
44
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
55
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
66
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>

docker/docker-compose.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Using docker-compose to config startup environment
2+
3+
please install docker and docker-compose first : https://docs.docker.com/compose/install/
4+
5+
#### Running environment start up
6+
7+
1. Access the docker folder (`cd docker`)
8+
1. launch the environment by docker compose (`docker-compose up -d`)
9+
1. access mysql as you want
10+
1. if there is conflict on port, just modify the corresponding port defined in docker-compose.yml and then launch docker compose again(`docker-compose up -d`)
11+
1. if you want to stop the environment, use command `docker-compose down`

docker/docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3.3'
2+
services:
3+
mysql:
4+
image: 'mysql:5.7'
5+
environment:
6+
MYSQL_ROOT_PASSWORD: start_db
7+
MYSQL_USER: start_db
8+
MYSQL_PASSWORD: start_db
9+
MYSQL_DATABASE: meta_data
10+
ports:
11+
- '3306:3306'

0 commit comments

Comments
 (0)