Skip to content

Commit fccb4fa

Browse files
authoredMay 3, 2023
Update README.md
1 parent 1ddb7cf commit fccb4fa

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed
 

‎README.md

+24-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
# Java Demo App
22

3-
**The App**
3+
## The App
44

55
This is a simple Sales Manager Java App that stores sales items in a table presented in a web app.
66

7-
This demo repo is designed to help understand some of **CI/CD** (Continuous Integration/Continuous Delivery) principles and best practices.
7+
This demo repo is designed to help understand some of **CI/CD** ([Continuous Integration](https://docs.github.com/en/enterprise-cloud@latest/actions/automating-builds-and-tests/about-continuous-integration)/[Continuous Delivery](https://docs.github.com/en/enterprise-cloud@latest/actions/deployment/about-deployments/about-continuous-deployment)) principles and best practices.
88

9-
**The Settings**
9+
## The Setting
1010

1111
**Java** (Spring Boot framework) with **MVC** (Model View Controller) and **OOP** (Object Oriented Programming) design patterns.
12+
Backend Database is Oracle XE 11g PDB (but can be used with other versions).
1213

1314
*CI/CD Pipeline*
1415
[GitHub Actions](https://docs.github.com/en/enterprise-cloud@latest/actions) as the main CI/CD pipeline orchestrator
1516

1617
**Tools used to optimize the pipeline (See the `.github/workflows/ci.yml` for more detailed configuration).**
1718
- [Caching Dependencies to Speed Up Workflows](https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/caching-dependencies-to-speed-up-workflows)
18-
- Reusing Docker Layer Caching from pervious docker builds with [action-docker-layer-caching](https://github.com/satackey/action-docker-layer-caching) or [build-push-action](https://github.com/docker/build-push-action) actions.
19-
- Using the [Metrix Strategy] to Run Unit Tests In Parallel(https://docs.github.com/en/enterprise-cloud@latest/actions/using-jobs/using-a-matrix-for-your-jobs) to scale-out resources and reduce significant testing time.
19+
- Reusing **Docker Layer Caching** from pervious docker builds with [action-docker-layer-caching](https://github.com/satackey/action-docker-layer-caching) or [build-push-action](https://github.com/docker/build-push-action) actions.
20+
- Using the [Metrix Strategy](https://docs.github.com/en/enterprise-cloud@latest/actions/using-jobs/using-a-matrix-for-your-jobs) to run unit tests in parallel to scale-out resources and reduce significant testing time.
21+
- Using the [Split Test Action](https://github.com/marketplace/actions/split-tests) to help splitting tests by previous testing time runs or line count (or other strategies) across multiple runners.
22+
- [GitHub Advanced Security](https://docs.github.com/en/enterprise-cloud@latest/get-started/learning-about-github/about-github-advanced-security) - Code Scanning using the [CodeQL analysis](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages) to scan for vulnerabilities.
23+
- [Liquibase Quality Checks](https://www.liquibase.com/quality-checks) - To help enforce Database schema changes best practices set by your DBA team, including naming conventions, grants & revokes, rollback scripts and security risks.
2024

2125
# CI/CD Diagram
2226
```mermaid
@@ -49,27 +53,33 @@ stateDiagram
4953
```
5054

5155
*Building and Testing*
52-
- [Maven](https://maven.apache.org/) as the project management for Building and Testing the application.
53-
The user input data from the app's view is stored in an Oracle (PDB) Database.
54-
56+
[Maven](https://maven.apache.org/) is used as the project management for Building and Testing the application.
57+
To build the application, you can run:
58+
```
59+
mvn clean package
60+
```
61+
It will generate a JAR file in the `target` folder with the following format `salesmanager-x.x.x-SNAPSHOT.jar`. </br>
62+
To run the application, you can deploy the JAR file. For example:
63+
```
64+
java -jar target/salesmanager-0.0.6-SNAPSHOT.jar
65+
```
5566

5667
# How to Demo
57-
For easy demos, an H2 database (Oracle Mode) is setup by default in the `src/main/resources/application.properties` file. </br>
58-
You can easily use a [GitHub codespaces](https://docs.github.com/en/enterprise-cloud@latest/codespaces) with this repository. </br>
59-
To set up your codespace, simply go to this repo [main page](https://github.com/octodemo/java-springboot-demo) --> Click **Code** --> Codespaces '+'. </br>
68+
For easy demos without the need to stand up an Oracle database, an lightweight local [H2 database](https://www.h2database.com/html/main.html) (Oracle Mode) is setup by default in the `src/main/resources/application.properties` file. </br>
6069
You can run the `./build_and_run_app.sh` helper shell script and interact with the web app on `localhost:8086`.
70+
> You can easily use a [GitHub codespaces](https://docs.github.com/en/enterprise-cloud@latest/codespaces) with this repository. To set up your codespace, simply go to this repo [main page](https://github.com/octodemo/java-springboot-demo) --> Click **Code** --> Codespaces '+'. </br>
6171
6272

63-
Running the CI workflow
73+
# Running the CI workflow
6474
1. In order to run the workflow, you will need to [fork](https://docs.github.com/en/enterprise-cloud@latest/get-started/quickstart/fork-a-repo) this repo. </br>
6575
2. Then, make sure to save the following environment variables in your repository secrets so you can successfully run the Database schema mirgations scripts (using [Liquibase](https://www.liquibase.com/) as the schema migration tool) on application startup and when running the tests. </br>
6676

67-
Repository Secrets
77+
**Repository Secrets**
6878
`LIQUIBASE_COMMAND_URL`
6979
`LIQUIBASE_COMMAND_USERNAME`
7080
`LIQUIBASE_COMMAND_PASSWORD`
7181

72-
If you are going to use the same [dockerised service container](https://hub.docker.com/r/gvenzl/oracle-xe) in the CI job for dev, then the default values should be: </br>
82+
### If you are going to use the same [dockerised service container](https://hub.docker.com/r/gvenzl/oracle-xe) in the CI job for dev, then the default values should be: </br>
7383
`LIQUIBASE_COMMAND_URL` = `jdbc:oracle:thin:@oracle:1521/xe` </br>
7484
`LIQUIBASE_COMMAND_USERNAME` = `SYSTEM` </br>
7585
`LIQUIBASE_COMMAND_PASSWORD` = `ORACLE`

0 commit comments

Comments
 (0)