https://github.com/developer-rakeshpaul/jenkins-spring-boot-api
https://github.com/developer-rakeshpaul/jenkins-spring-boot-api
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/developer-rakeshpaul/jenkins-spring-boot-api
- Owner: developer-rakeshpaul
- Created: 2022-06-24T04:28:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-30T03:11:31.000Z (almost 3 years ago)
- Last Synced: 2025-01-26T10:12:17.528Z (4 months ago)
- Language: HCL
- Size: 75.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/tkgregory/spring-boot-api-example/actions/workflows/gradle.yml)
## Overview
An example project to demonstrate:
* how to create a Spring Boot REST API ([article](https://tomgregory.com/building-a-spring-boot-application-in-jenkins/) | [video](https://youtu.be/sCcuUMn1vdM))
* how to run Spring Boot in Docker and publish to Docker Hub ([article](https://tomgregory.com/building-a-spring-boot-application-in-docker-and-jenkins/) | [video](https://youtu.be/Kc3Vw5vk1Lw))
* how to deploy the Spring Boot application to AWS with CloudFormation ([article](https://tomgregory.com/deploying-a-spring-boot-application-into-aws-with-jenkins/) | [video](https://youtu.be/5xh0nAYeZNc))## Pre-requisites
* JDK 8+
* Docker## Building
### Testing
`./gradlew test`
### Building (no tests)
`./gradlew assemble`
### Building (with tests)
`./gradlew build`
### Running in Docker
`./gradlew assemble docker dockerRun`
### Stopping Docker container
`./gradlew dockerStop`
### Deploying to AWS
`./gradlew awsCfnMigrateStack awsCfnWaitStackComplete -PsubnetId= -Pregion=`
### Deleting AWS deployment
`./gradlew awsCfnDeleteStack awsCfnWaitStackComplete`
## Using API
* get all rides - GET [/ride](http://localhost:8080/ride) to get a list of all the rides
* get specific ride - GET [/ride/${id}](http://localhost:8080/ride/1) to get a specific ride
* create ride - POST JSON to [/ride](http://localhost:8080/ride) to create a new ride
(see [article](https://tomgregory.com/building-a-spring-boot-application-in-jenkins/#2_Trying_out_our_Spring_Boot_application) for full details)## Need further support?
Contact me if you need help at [email protected].