Spring boot testing project for play around features for spring boot, test cases and api docs.
Current active working branch is development.
This project makes use of Project Lombok, so you need to setup your IDE to use lombok, just dropin a jar. More details at: https://projectlombok.org/
Requires Java 8, Maven 4, Lombok
Checkout the project
navigate to development branch.
Navigate to project root, issue command: mvn spring-boot:run
Navigate to: http://localhost:8080/users
It is noticed that Ctrl+c won't terminate the springboot app. The solution on windows is to find the id and kill the process:
d:\> netstat -ano | find "8080"
d:\> taskkill /F /PID 19276 -- 19726 is process id retrieved in previous step
mvn package
. Will generate jar file under target folderjava -jar target/springboot-sample-0.0.1-SNAPSHOT.jar
More Details at:
https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins.html
docker --version
mvn package && mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
docker build -t springboot-sample .
to build docker containerdocker run -p 8080:8080 -t springboot-sample:latest
to kickoff the server
docker run -e "JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" -p 8080:8080 -p 5005:5005 -t springboot-sample
More Details at:
https://spring.io/guides/gs/spring-boot-docker/
docker --version
kubectl version
./kubectl-build.sh
to kickoff deployment on kuberneteskubectl expose deployment springboot-sample --type=LoadBalancer --port 8080 --target-port 8080
More Details at:
https://spring.io/guides/gs/spring-boot-kubernetes/
https://kubernetes.io/docs/tutorials/kubernetes-basics/
https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0
Setup Jenkins using Docker container from: https://hub.docker.com/r/jenkins/jenkins
docker pull jenkins/jenkins
sudo docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts
Jenkinsfile
is already checked into root of project. Copyright (c) 2020 Taha Iqbal
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.