Pradipbabar / java-devops

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JAVA SpringBoot Microservices CI/CD DevOps Project

Prerequisites

  • Set up WSL2 with Ubuntu 20.04 + (preferably 22.04)
  • OS Windows 11 22H2
  • AWS Free Tier Account
  • Github Account
  • Postman API Testing tool
  • VSCode

Setup Inside WSL Ubuntu

Get Started with the Project

  1. Clone the Git Repository in WSL at your "repos" location
  2. Start the Docker service
  3. run docker-compose up -d

Creating a springboot project

  1. Create a new Spring Project with Maven
  2. Dependancies
    • Spring JPA for Data
    • MySQL Driver
    • Spring web

Building the projects in Maven containers -

  1. To build the productservice app, execute [docker-compose run --rm mvn-product clean package -DskipTests]
  2. To build the couponservice app, execute [docker-compose run --rm mvn-coupon clean package -DskipTests]

Postman calls to create Coupon & Products

  • Create a coupon
{
    "code":"XMAS",
    "discount":25,
    "expDate":"26/12/2022"
}
  • Create a product
{
    "name":"X-mas Tree",
    "description": "A must have in your Xmas decoration",
    "price": 75,
    "couponCode": "XMAS"
}

About


Languages

Language:Java 57.0%Language:HCL 23.2%Language:Dockerfile 19.8%