Skip to content

CloudSihmar/devsecops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to the DevOps test repository for Maven projects

************************************************************

To use this, your system (Centos 7) should have below tools installed:
git  //you can use "yum install git -y" for this


maven  insallation : install latest version instead of mvn install on terminal..

wget https://dlcdn.apache.org/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.tar.gz
  114  tar -xvzf apache-maven-3.9.4-bin.tar.gz 
  116  cd apache-maven-3.9.4/
  128  ln -s  /root/apache-maven-3.9.4/bin/mvn  /usr/bin/
  129  mvn --version

java installation : latest (skip it if jenkins alread insalled with java 11)
yum update -y
   35  yum install openjdk-17-jdk


jenkins //follow the installation guideline at https://www.jenkins.io/doc/book/installing/#red-hat-centos
docker // you can install docker :

 sudo yum install -y yum-utils
 sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
    
    
 sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
 
 systemctl start docker
---


systemctl status jenkins
  482  vi /usr/lib/systemd/system/jenkins.service
  483  cat /usr/lib/systemd/system/jenkins.service
  484  clear
  485  systemctl daemon-reload
  486  systemctl restart jenkins

-------


use maven to clean the previous builds and  package the war file 
mvn clean
mvn package

check the outputs in target directory structure and war file with name devops.war

build the docker image with docker build command ( you can see dockerfile in present working directory)
docker build -t image-name:version .

docker rm -f `docker ps -aq`

Run a container from the image
docker run -d -p 8081:8080 --name mynewcontainer image-name:version    {8080 port is taken by jenkins}

Check your system IP in browser :
IP:8081/devops


Lab completed**

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •