++ Note: This project is still WIP ++
This repo contains a skeleton template for creating new microservices.
It is an opinionated template where certain technology/tool/framework have been chosen...
- High Level Architecture
- Programming Language
- Application Framework
- Build
- Continuous Integration (CI)
- Continuous Delivery (CD)
- Continuous Deployment (CD)
- Infrastructure As Code
- Deploymemt
- API Documentation
- Java 8
- Spring Boot 2.0+
Both Maven and Gradle are supported. However, Maven is currently the main build system used for this project to manage the release.
Maven
Maven wrapper is used so that no need to install Maven on your machine beforehand. Lets maven wrapper take care of maven.
Gradle
Just like Maven, Gradle offers the Gradle wrapper is used so that no need to install Gradle on your machine beforehand.
See Jenkinsfile
which is a config file for defining build settings on Jenkins 2.0+ (with the use of Pipelines).
Only Jenkins 2.0+ is supported.
Every commit/merge is a RC (Release Candidate).
See Jenkinsfile
's section on Continous Delivery.
Mainly it is about the automated deployment from a testing environment (Staging) onto live Production. Normally, or historically, this would be a manual process done by the Operations Team (Ops).
See Jenkinsfile
's section on Continous Deployment.
CD is facilitated by the shell script deploy.sh
which you can use and edit to define the steps and behaviours for
doing the deployment. In Jenkins pipeline, we have a sanity check stage which governs or acts as a gate prior for the software
to be deloyed onto Production. (Artifact/Pipeline promotion).
To implement IAC, Terraform is used. You can place your terraform files in the terraform
directory.
This template assumes the project will be deployed onto the Cloud or to any other infrastructure that is supported by Terraform.
If deploying to a bare metal physical server machine or to Virtual Machines, one might decide to use a configuration management tool such as Ansible, Puppet, or Chef a like to automate the provisioning of the infrastructure instead. Currently this template does not offer support for this. As normally, these deployment methods normally reside in a separate source code repository hence this subject matter is out of the scope of this template project.
See Dockerfile
in the root of the project directory.
Building a Docker container
./mvnw clean package
or execute Docker directly:
docker build -t microservices-template:1.0.0-SNAPSHOT .
Using an container orchestration framework to manage the containers. This template project is opinionated towards Kubernetes. It is to note that other container orchestration platforms exists (Docker Swarm, Nomad with Consul, Apache Mesos on DC/OS etc).
kubectl apply -f deployment/microservices-template.yml
Use of Swagger to document our microservice's API REST endpoints.
Access Swagger on:
http://{microservices-template-service-url}:{port}/swagger-ui.html