Microservice Template gives you a
- SpringBoot App template with
- Open API 3 Ex,
- Spring Actuator,
- Spring Sleuth and
- POM File with (SpringBoot) Fat and Thin (Maven) jar file creation and
- Dockerfile for containerisation.
- Update the Org Name in src/main/resources/app.props.tmpl file (service.org)
- Update the Microservice name in src/main/resources/app.props.tmpl file (service.name)
- Update the API Version in src/main/resources/app.props.tmpl file (service.api.version)
- Update the API Name in src/main/resources/app.props.tmpl file (service.api.name)
- Update the Container Name in src/main/resources/app.props.tmpl file (service.container)
- Update the Server Version src/main/resources/app.props.tmpl file (server.version)
- Update the SRC_BASE (Your Service Repository Base Directory) in getServiceName shell script
When you change the version in POM.xml, update that info in src/main/resources/app.props.tmpl - service.version property also.
- compile
The above compile script will do the following
- Clean up the target folder
- Generate the build no. and build date (takes application.properties backup)
- build final output SpringBoot fat jar and maven thin jar
- copy the jar files (and dependencis) to src/docker folder
- copy the application.properties file to current folder and src/docker folder
In Step 2.2 application.properties file will be auto generated by the compile script. This is a critical step. Without generated application.properties file the service will not be running.
- run
- test
- Verify the Org Name in src/main/resources/app.props.tmpl file (service.org)
- Verify the container name in src/main/resources/app.props.tmpl file (service.container)
- Verify the microservice name in src/main/resources/app.props.tmpl file (service.api.name)
- build (Build the Container)
- scan (Scan the container vulnerabilities)
- start (Start the Container)
- logs (to view the container logs) - Wait for the Container to Startup
- Check the URL in a Browser
Update the Org Name in src/main/resources/app.props.tmpl file (service.org) Setup the Docker Hub or any other Container Registry
- push (Push the Container to Docker Hub)
- stop (Stop the Container)_
- stats (show container stats)
(C) Copyright 2021 - MetArivu Author: Araf Karsh Hamid