- Install Java
- Install Maven
- Install Docker
- Install Docker-compose
- Install jenkins
- Ansible Setup
amazon-linux-extras install ansible2 -y
ssh-keygen
vi /etc/ansible/hosts
ansible -m ping <Slave-Server-IP>
yum install java-1.8.0-openjdk-devel -y
yum install maven -y
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum install jenkins -y
service jenkins start
yum install docker -y
service docker start
usermod -aG docker jenkins
service jenkins restart
visudo
--------
jenkins ALL=(ALL) NOPASSWD: ALL
--------
yum install python3-pip -y
pip3 install docker-compose
git clone https://github.com/Naresh240/docker.git
cd docker/springboot-mongodb-dockercompose
mvn clean install -DskipTests=true
docker build -t naresh240/springboot-mongodb:latest .
docker login -u naresh240 -p
docker push naresh240/springboot-mongodb:latest
Step1: Integreate Git and Maven with Jenkins
Step2: Create Docker Credentials
Step3: Create Jenkins Pipeline Job and copy jenkins pipeline inside pipeline section
Step4: Build Jenkins job
Check API: /addEmployee
http://<ip-address>:8080/addEmployee
In postman app keep Post method and give Json data by selecting Body --> raw (Json format)
{"id": "1001", "name": "Naresh", "departement": "Engineer"}
Check API:- /findAllEmployees
Goto Web UI and check below link
http://<ip-address>:8080/findAllEmployees
Check API: /addEmployee
http://<ip-address>:8080/addEmployee
In postman app keep Post method and give Json data by selecting Body --> raw (Json format)
{"id": "1001", "name": "Naresh", "departement": "Engineer"}
Check API:- /findAllEmployees
Goto Web UI and check below link
http://<ip-address>:8080/findAllEmployees