- JDK 11
- MySQL server
8.0
https://docs.google.com/spreadsheets/d/1KxQl1WfR2FG1R0Vtn7Dc-QOlUe5k6wQ2Z6_IeMp1eGU/edit#gid=2021277810
- Get mysql image
docker pull mysql/mysql-server:8.0
- Run docker
docker run --name=mysql1 -p3306:3306 -e MYSQL_ROOT_PASSWORD=sdlc -e MYSQL_DATABASE=sdlc_poc -e MYSQL_USER=sdlc -e MYSQL_PASSWORD=sdlc -e MYSQL_ONETIME_PASSWORD=false -d mysql/mysql-server:8.0
- Connecting to MySQL Server from within the Container to change root password
docker exec -it mysql1 mysql -uroot -p ALTER USER 'root'@'localhost' IDENTIFIED BY 'sdlc';
4.Run sql file sdlc_schema_20201013.sql
in container:
https://dev.to/n350071/login-to-mysql-on-docker-and-run-a-sql-file-2bk7
- Run MySQL server
- Edit database settings on src/main/resources/application-default.yml
spring: datasource: url: jdbc:mysql://{mysql server host}:{port}/{database}?useSSL=false username: {username} password: {password}
- Build teh schema in the database w/ DDL.
- Run the service
./gradlew bootRun
We use (google code style)[https://google.github.io/styleguide/javaguide.html]. You might be able to find the code formatter setting file written for your editor here: https://github.com/google/styleguide
Unit test is integrated in the build process.
You also can run the tests as below.
bash ./gradlew test
- Building with Gradle
./gradlew build
-
There are 3 command-line parameters:
./gradlew bootRun --args="--proc=import --dir=C:\Users\LW81343\Desktop\base_code1\data-importer\testdata\root_folder --project=projectA"
- proc: this is name of process you want to run: import for "import HTML file to mysql"
- dir (required) : this is the path to rootFolder. The rootFolder contains all project Folders like: projectA, projectB
- project (optional): If do not provide this option, the application will process all folders in root folder.
- In project folder, if it had any files(with .html extension) in that, application will delete all data related to that project includes: project, urs, frs, urs detail, frs detail, ... Otherwise, it will skip.
TODO:
- update logic according to clarification in forums.
- category classes by configuration
- code format