Posts

Showing posts with the label Spring Boot

Creating first Jenkins pipeline: tutorial

Image
Jenkins uses a feature called Jenkins Pipeline which is a collection of jobs that brings the software from version control into the hands of the end-users by using automation tools. They represent multiple Jenkins jobs as one whole workflow in the form of a pipeline. In this blog, I am going to share my knowledge on how can we write multiple Jenkins jobs as a pipeline and it uses two different syntaxes i.e. Declarative and Scripted pipeline and i n our examples, we're going to use the Scripted Pipeline which is following a more imperative programming model built with Groovy. Prerequisite: Code on bitbucket/ GitHub Jenkins Installation Download required plugins to run pipelines like Pipeline, SonarQube Scanner, Check Style, Junit, Git Integration, Maven Integration. Sonar up and running.   Let’s start creating pipeline will do below tasks: Clone  Project from Jenkins Build and run Junit test cases Run Sonar Run Checkstyle Package it as a jar file ...

Continuous Integration with Jenkins and Spring Boot App

Image
Jenkins can be used for multiple purposes like whenever any developer commits any code changes to SCM, Jenkins triggers job which can Checkout the code, build it, run JUnit test case, run tools like sonar or checkmarx and if everything works properly then deploy it to some instance. In this tutorial, I’ll share my knowledge on how can we automate our test process by introducing CI like Jenkins. We will configure Jenkins such that it should trigger it whenever any code commits by any developer to SCM, pull out the code from GIT, run maven to build and test the code. Prerequisite: Code upload on GIT (or use this link ) Jenkins up and running. Refer here for installation.    Once your Jenkins is up and running then you will see below screen   Configuration Steps: ·        Install the required plugin. o    Make sure all the required plugins like GIT, Maven are already present o    Goto Manag...

Streaming Spring boot logs to ELK stack

Image
In my previous blog , we have done ELK installation on windows 10 and we have even tried to push messages from input console to Elastic Search and finally viewed on Kibana Server. I will write a separate blog on why do we need ELK? In this blog, I’ll show you how can we push spring boot application log directly to Elastic search using Logstash which we can analyze on Kibana and If you don’t know how to install ELK on windows 10 then you can refer my previous blog and start Elastic Search and Kibana server. Prerequisite Elastic Search and Kibana running on your machine Basic knowledge of Spring boot application If you don’t want to start your application from scratch then you can download one spring boot application from my GitHub repository as well. I am assuming that the Elastic Search and Kibana server are running on your machine and you have a fair idea of how to start the Logstash server and what is Logstash conf file. So, to push spring boot logs cont...

How to create Docker Image and push java app in a Docker Engine

Image
In this blog, I am going to share my knowledge on the creation of a docker image and how can we run in a Docker Engine. Prerequisite Basic Knowledge of Docker Docker must be running on your machine. Good to aware of Spring boot application. I already have one spring boot application in my IntelliJ which expose one endpoint /users/{id}. We will see how can we push and run this application in a docker container.  We need to create one file named Dockerfile to add docker instruction (Check above image). Now go to Terminal and check whether the docker is running or not on your machine. Run docker build to create an image and push it to the container using the command. docker build -f Dockerfile -t docker-spring-ehcache . The above command will execute all the operations that we have mentioned in our Dockerfile like pulling OpenJDK 8 from the docker hub if not exist. Let's see if our image got pushed to docker containers or not by listing all d...