Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jorgeacetozi/notepad
Sample Spring Boot app used in my book Continuous Delivery for Java Apps: Build a CD Pipeline Step by Step Using Kubernetes, Docker, Vagrant, Jenkins, Spring, Maven and Artifactory
https://github.com/jorgeacetozi/notepad
continuous-delivery continuous-integration docker kubernetes mysql spring-boot
Last synced: 2 months ago
JSON representation
Sample Spring Boot app used in my book Continuous Delivery for Java Apps: Build a CD Pipeline Step by Step Using Kubernetes, Docker, Vagrant, Jenkins, Spring, Maven and Artifactory
- Host: GitHub
- URL: https://github.com/jorgeacetozi/notepad
- Owner: jorgeacetozi
- Created: 2017-08-31T01:50:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-02-14T14:06:22.000Z (almost 4 years ago)
- Last Synced: 2023-02-27T10:06:45.156Z (almost 2 years ago)
- Topics: continuous-delivery, continuous-integration, docker, kubernetes, mysql, spring-boot
- Language: Java
- Homepage: https://leanpub.com/continuous-delivery-for-java-apps
- Size: 996 KB
- Stars: 15
- Watchers: 2
- Forks: 85
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Notepad: Simple Spring Boot App
This simple application is used for demo purposes. It exposes the `actuator` endpoints as well as the `/notes` endpoint, which creates a note when it gets a `POST` request.
## Usage
The Notepad stores the notes in a MySQL instance, so it expects the MySQL database to be up and running. The bellow command starts a MySQL container with a newly created database `notepad` in it. It also sets up the mysql root password as `root`.
`$ docker run -d --name mysql -e MYSQL_DATABASE=notepad -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 mysql:5.7`
Now, clone this repository and go into the notepad directory:
`$ git clone https://github.com/jorgeacetozi/notepad.git`
`$ cd notepad`Once you succesfully cloned the repository, start the application the jar artifact:
`$ mvn clean install`
Wait for the unit and integration tests to run and the artifact to be generated. Eventually it will be stored in the `target/` directory.
Now, start the application:
`$ java -jar $(ls target/*.jar)`
Check that the application is up and running hitting the actuator `/health` endpoint:
`$ curl http://localhost:8080/health`
Create a new note:
`$ curl -H "Content-Type: application/json" -X POST -d '{"title":"Kubernetes","content":"Best container orchestration tool ever"}' http://localhost:8080/notes`
## Features
- `Flyway` to manage database migrations.
- `maven-surefire-plugin` to run only unit tests with `mvn test`.
- `maven-failsafe-plugin` to run unit and integrations tests with `mvn verify`.
- 1 simple unit test, 2 integrations tests (a api test to ensure that the JSON returned by the endpoint is correct) and a database test (saves a note and ensures that it was successfuly persisted in MySQL).
- `maven-release-plugin` to release new application versions in GitHub.