|
1 |
| -## Springboot app with Liquibase and Oracle Database |
2 |
| -This is a Maven project that demos how to run a Spring application in CircleCI/CD with the [Liquibase spring integration](https://www.liquibase.org/javadoc/liquibase/integration/spring/SpringLiquibase.html) and the Liquibase [Maven Plugin](https://docs.liquibase.com/tools-integrations/maven/home.html). |
| 1 | +# Java Demo App |
3 | 2 |
|
4 |
| -## GitHub Actions or CircleCI Workflows |
5 |
| -1. The workflow will first run [Quality Checks](https://www.liquibase.com/quality-checks) using the Liquibase [Maven Plugin](https://docs.liquibase.com/tools-integrations/maven/home.html). |
6 |
| -2. If the Quality Checks run successfully, the workflow will then build the application. That will include running the database changes with [Liquibase spring integration](https://www.liquibase.org/javadoc/liquibase/integration/spring/SpringLiquibase.html) and packaging the application code (compiling, running unit tests and generating artifacts). |
| 3 | +**The App** |
| 4 | + |
| 5 | +This is a simple Sales Manager Java App that stores sales items in a table presented in a web app. |
| 6 | + |
| 7 | +This demo repo is designed to help understand some of **CI/CD** (Continuous Integration/Continuous Delivery) principles and best practices. |
| 8 | + |
| 9 | +**The Settings** |
| 10 | + |
| 11 | +**Java** (Spring Boot framework) with **MVC** (Model View Controller) and **OOP** (Object Oriented Programming) design patterns. |
| 12 | + |
| 13 | + *CI/CD Pipeline* |
| 14 | + [GitHub Actions](https://docs.github.com/en/enterprise-cloud@latest/actions) as the main CI/CD pipeline orchestrator |
| 15 | +Tools used to optimize the pipeline (See the `.github/workflows/ci.yml` for more detailed configuration). |
| 16 | + |
| 17 | + - [Caching Dependencies to Speed Up Workflows](https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/caching-dependencies-to-speed-up-workflows) |
| 18 | + - [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) |
| 19 | + |
| 20 | +# CI/CD Diagram |
| 21 | +```mermaid |
| 22 | +stateDiagram |
| 23 | + state Continuous-Integration { |
| 24 | + Commits --> PR: Developers Commit new changes in a Pull Request |
| 25 | + PR --> CI: Security Scans, Build & Unit Test Suit |
| 26 | + CI --> PR: Feedback of failed tests - back to dev |
| 27 | + CI --> Publish: If CI passes, \nmerging to main branch \nand publishing Containerised\n App to GHCR |
| 28 | + } |
| 29 | + |
| 30 | + state Parallel-Testing { |
| 31 | + CI --> JunitTest1 |
| 32 | + CI --> JunitTest2 |
| 33 | + CI --> JunitTest3 |
| 34 | + CI --> JunitTest..N |
| 35 | + } |
| 36 | + |
| 37 | + state Continuous-Delivery { |
| 38 | + Publish --> PreProdTests: Pulling Image from GHDR |
| 39 | + PreProdTests --> Deploy: Deploy the app to K8s |
| 40 | + } |
| 41 | +``` |
| 42 | + |
| 43 | +# Gitgraph Diagram - Developer Workflow |
| 44 | +```mermaid |
| 45 | +%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true}} }%% |
| 46 | + gitGraph |
| 47 | + commit |
| 48 | + branch hotfix |
| 49 | + checkout hotfix |
| 50 | + commit |
| 51 | + branch develop |
| 52 | + checkout develop |
| 53 | + commit id:"ash" tag:"abc" |
| 54 | + branch featureB |
| 55 | + checkout featureB |
| 56 | + commit type:HIGHLIGHT |
| 57 | + checkout main |
| 58 | + checkout hotfix |
| 59 | + commit type:NORMAL |
| 60 | + checkout develop |
| 61 | + commit type:REVERSE |
| 62 | + checkout featureB |
| 63 | + commit |
| 64 | + checkout main |
| 65 | + merge hotfix |
| 66 | + checkout featureB |
| 67 | + commit |
| 68 | + checkout develop |
| 69 | + branch featureA |
| 70 | + commit |
| 71 | + checkout develop |
| 72 | + merge hotfix |
| 73 | + checkout featureA |
| 74 | + commit |
| 75 | + checkout featureB |
| 76 | + commit |
| 77 | + checkout develop |
| 78 | + merge featureA |
| 79 | + branch release |
| 80 | + checkout release |
| 81 | + commit |
| 82 | + checkout main |
| 83 | + commit |
| 84 | + checkout release |
| 85 | + merge main |
| 86 | + checkout develop |
| 87 | + merge release |
| 88 | +``` |
| 89 | + |
| 90 | + *Building and Testing* |
| 91 | + - [Maven](https://maven.apache.org/) as the project management for Building and Testing the application. |
| 92 | + |
| 93 | + |
| 94 | +User input data is stored in an Oracle (PDB) Database. |
| 95 | + |
| 96 | + |
| 97 | +For easy demos, an H2 database (Oracle Mode) is setup by default in the `src/main/resources/application.properties` file. |
0 commit comments