diff --git a/Dockerfile b/Dockerfile index 74a00407b6..012ca4e946 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,3 @@ FROM tomcat:8.0.20-jre8 -# Dummy text to test -COPY target/maven-web-application*.war /usr/local/tomcat/webapps/maven-web-application.war +### Good stuff +COPY target/*.war /usr/local/tomcat/webapps/maven-web-app.war diff --git a/Jenkinsfile b/Jenkinsfile index 82d63ae784..f393b56cb2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,11 +43,11 @@ node stage('EmailNotification') { - mail bcc: 'devopstrainingblr@gmail.com', body: '''Build is over + mail bcc: 'mylandmarktech@gmail.com', body: '''Build is over Thanks, - Mithun Technologies, - 9980923226.''', cc: 'devopstrainingblr@gmail.com', from: '', replyTo: '', subject: 'Build is over!!', to: 'devopstrainingblr@gmail.com' + Landmark Technologies, + +14372152483.''', cc: 'mylandmarktech@gmail.com', from: '', replyTo: '', subject: 'Build is over!!', to: 'mylandmarktech@gmail.com' } */ diff --git a/Jenkinsfile-ebay b/Jenkinsfile-ebay new file mode 100644 index 0000000000..a818e5c663 --- /dev/null +++ b/Jenkinsfile-ebay @@ -0,0 +1,41 @@ +node { + def mavenHome = tool name: 'maven3.8.2' + stage('1-Clone') { + git credentialsId: 'GitHUB-CREDENTIALS', url: 'https://github.com/Landmark-Technologies/maven-web-application' + } + stage('2-mavenBuild') { + sh "${mavenHome}/bin/mvn clean package" + } + /* + stage('3-CodeQuality') { + sh "${mavenHome}/bin/mvn sonar:sonar" + } + stage('4-UploadArticats') { + sh "${mavenHome}/bin/mvn deploy" + } + + stage('5-Deploy-UAT') { + deploy adapters: [tomcat9(credentialsId: 'deploy', path: '', url: 'http://54.204.83.221:8000/')], contextPath: null, war: 'target/*.war' + } + stage('6-EmailN') { + emailext body: '''Hello Everyone, + +Build from Ebay pipeline project. + +Landmark Tecxhnologies''', subject: 'Build status', to: 'developers' + } + stage('Approval'){ + timeout(time:8, unit: 'HOURS' ) { + input message: 'Please verify and approve' + } + + } + stage('prod-Deploy'){ + deploy adapters: [tomcat9(credentialsId: 'deploy', path: '', url: 'http://54.204.83.221:8000/')], contextPath: null, war: 'target/*.war' + } + */ + + /* + */ + +} diff --git a/JenkinsfileDeclarative b/JenkinsfileDeclarative new file mode 100644 index 0000000000..da4fee7347 --- /dev/null +++ b/JenkinsfileDeclarative @@ -0,0 +1,83 @@ +pipeline{ + +agent any + +tools +{ + maven 'maven3.6.3' + +} + +triggers{ + pollSCM('* * * * *') +} + +options{ + timestamps() + buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '2', daysToKeepStr: '', numToKeepStr: '2')) +} + + stages{ + + stage('CheckoutCode') + { + steps{ + git branch: 'development', credentialsId: '8e348aa2-9531-4dbe-863d-1adb64897470', url: 'https://github.com/LandmakTechnology/maven-web-application.git' + } + } + + stage('Build') + { + steps{ + sh "mvn clean package" + } + } + + stage('ExecuteSonarQubeReport') + { + steps{ + sh "mvn sonar:sonar" + } + } + + stage('UploadArtifactintoNexus') + { + steps{ + sh "mvn deploy" + } + } + + stage('DeployAppIntoTomcat') + { + steps{ + sshagent(['2b7b0c6a-5eff-4f4a-82c3-3630f91c70b5']) { + sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war ec2-user@3.1.222.74:/opt/apache-tomcat-9.0.41/webapps/" + } + } + } + + + + } + + post{ + + + success{ + mail bcc: 'mylandmarktech@gmail.com', body: '''BuildOver!.... + + Regards, + Landmark Technologies, + 9980923226''', cc: 'mylandmarktech@gmail.com', from: '', replyTo: '', subject: 'BuildOver!!', to: 'mylandmarktech@gmail.com' + } + + failure{ + mail bcc: 'devopstrainingblr@gmail.com', body: '''BuildOver!.... + + Regards, + Landmark Technologies, + +1 437 215 2483,''', cc: 'mylandmarktech@gmail.com', from: '', replyTo: '', subject: 'BuildOver!!', to: 'mylandmarktech@gmail.com' + } + + } +} diff --git a/JenkinsfileJuly2021 b/JenkinsfileJuly2021 new file mode 100644 index 0000000000..aa3cf4f010 --- /dev/null +++ b/JenkinsfileJuly2021 @@ -0,0 +1,51 @@ +node('wallmart-node'){ + + def mavenHome = tool name: "maven3.8.2" + + echo "GitHub BranhName ${env.BRANCH_NAME}" + echo "Jenkins Job Number ${env.BUILD_NUMBER}" + echo "Jenkins Node Name ${env.NODE_NAME}" + + echo "Jenkins Home ${env.JENKINS_HOME}" + echo "Jenkins URL ${env.JENKINS_URL}" + echo "JOB Name ${env.JOB_NAME}" + + stage('CheckOutCode') + { + git branch: 'development', credentialsId: '12993250-1ff3-40a0-9978-794e74dcf712', url: 'https://github.com/LandmakTechnology/maven-web-application.git' + } + + stage('Build') + { + sh "${mavenHome}/bin/mvn clean package" + } + +/* + stage('SonarQubeReport'){ + sh "${mavenHome}/bin/mvn clean sonar:sonar" + } + + + stage('UploadArtifactIntoNexus'){ + sh "${mavenHome}/bin/mvn clean deploy" + } + + stage('DeployAppIntoTomcatServer') + { + sshagent(['c7a7b3d8-55f0-4f83-9e81-d56c154cc647']) { + sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war ec2-user@15.206.90.6:/opt/apache-tomcat-9.0.52/webapps/" + } + } + + */ + + stage('SendEmailNotification'){ + emailext body: '''Build is over !! + + Regards, + Landmark Technologies, + 9980923226''', subject: 'Build Over... !!', to: 'mylandmarktech@gmail.com' + } + + +} diff --git a/Jenkinsfile_docker b/Jenkinsfile_docker new file mode 100644 index 0000000000..316ce0930b --- /dev/null +++ b/Jenkinsfile_docker @@ -0,0 +1,60 @@ +pipeline{ + agent any + tools{ + maven "maven3.8.4" + } + stages{ + stage('GitClone'){ + steps{ + echo "cloning the lastest applications version" + git "https://github.com/LandmakTechnology/maven-web-application" + } + } + stage('Test+Build'){ + steps{ + sh "echo Running unitTesting" + sh "mvn clean package" + echo "echo test successful and backupArtifacts created" + } + } + stage('codeQuality'){ + steps{ + sh "echo Running detail code analysis" + sh "mvn sonar:sonar" + sh "echo All conditions met/passed" + } + } + stage('upLoadArtifacts'){ + steps{ + sh "echo Running detail code analysis" + sh "mvn deploy" + sh "echo backupArtifacts in nexus" + } + } + stage('predeployment'){ + steps{ + sh "echo creating docker image" + sh "docker build -t mylandmarktech/maven-web-app . " + sh "docker push mylandmarktech/maven-web-app" + } + } + stage('UnDeploy'){ + steps{ + sh "echo UNDEPLOYING existing application" + sh "docker rm -f webapp" + } + } + stage('deployment'){ + steps{ + sh "echo application ready for deployment" + sh "docker run -d -p 8000:8080 --name webapp mylandmarktech/maven-web-app" + } + } + stage('emailNotification'){ + steps{ + sh "echo deployment successful" + } + } + + } +} diff --git a/JenkinsfiledeclarativeJuneBathc b/JenkinsfiledeclarativeJuneBathc new file mode 100644 index 0000000000..a45c9ccafc --- /dev/null +++ b/JenkinsfiledeclarativeJuneBathc @@ -0,0 +1,77 @@ +pipeline{ + +agent{ +label 'slaves' +} + +tools{ +maven 'maven3.6.3' + +} + +triggers{ +pollSCM('* * * * *') +} + +options{ +timestamps() +buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5')) +} + +stages{ + + stage('CheckOutCode'){ + steps{ + git branch: 'development', credentialsId: '957b543e-6f77-4cef-9aec-82e9b0230975', url: 'https://github.com/LandmakTechnology/maven-web-application-1.git' + + } + } + + stage('Build'){ + steps{ + sh "mvn clean package" + } + } +/* + stage('ExecuteSonarQubeReport'){ + steps{ + sh "mvn clean sonar:sonar" + } + } + + stage('UploadArtifactsIntoNexus'){ + steps{ + sh "mvn clean deploy" + } + } + + stage('DeployAppIntoTomcat'){ + steps{ + sshagent(['bfe1b3c1-c29b-4a4d-b97a-c068b7748cd0']) { + sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war ec2-user@35.154.190.162:/opt/apache-tomcat-9.0.50/webapps/" + } + } + } + */ +}//Stages Closing + +post{ + + success{ + emailext to: 'mylandmarktech@gmail.com,mylandmarktech@yahoo.com', + subject: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.", + body: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.", + replyTo: 'mylandmarktech@gmail.com' + } + + failure{ + emailext to: 'mylandmarktech@gmail.com,mylandmarktech@yahoo.com', + subject: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.", + body: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.", + replyTo: 'mylandmarktech@gmail.com' + } + +} + + +}//Pipeline closing diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..0fc4c94d29 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3.1' +services: + springboot: + image: mylandmarktech/maven-web-app:VERSION + restart: always + ports: + - 9090:8080 + networks: + - mavenappbridge +networks: + mavenappbridge: diff --git a/pom.xml b/pom.xml index 3c18c3bbad..b318ad4953 100644 --- a/pom.xml +++ b/pom.xml @@ -21,9 +21,9 @@ 5.1.2.RELEASE 4.11 1.2.17 - http:3.238.135.186:9000/ + http:3.96.67.73:7000/ admin - admin + admin123 UTF-8 UTF-8 @@ -97,13 +97,13 @@ nexus Landmark Technologies Releases Nexus Repository - http://44.192.81.238:8888/mylandmarktech/repository/boa-release/ + http://172.31.18.29:8081/repository/ebay-bts-releases/ nexus Landmark Technologies Snapshot Nexus Repository - http://44.192.81.238:8888/mylandmarktech/repository/boa-snapshot/ + http://100.24.52.91:4000/repository/ebay-bts-snapshot/ diff --git a/src/main/java/com/mt/services/EmployeeService.java b/src/main/java/com/mt/services/EmployeeService.java index 4adb3c157b..27082bce45 100644 --- a/src/main/java/com/mt/services/EmployeeService.java +++ b/src/main/java/com/mt/services/EmployeeService.java @@ -1,32 +1,33 @@ -package com.mt.services; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.json.JSONException; -import org.json.JSONObject; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; - -@Controller -@RequestMapping("/employee") -public class EmployeeService { - - - @RequestMapping(value = "/getEmployeeDetails", method = RequestMethod.GET) - @ResponseBody - String uploadImage(HttpServletRequest request, HttpServletResponse response, HttpSession httpSession) - throws JSONException { - - JSONObject js = new JSONObject(); - js.put("Name", "Landmark Technologies"); - js.put("Calling Name", "mylandmark"); - js.put("DOB", "May 1, 2005"); - js.put("Hobbies", "Praying, Singing, Reading Technical Blogs,Teaching, Helping to Poor People.."); - js.put("Places he like", "Africa, NA, Bali"); - return js.toString(); -} -} +package com.mt.services; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.json.JSONException; +import org.json.JSONObject; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +@Controller +@RequestMapping("/employee") +public class EmployeeService { + + + @RequestMapping(value = "/getEmployeeDetails", method = RequestMethod.GET) + @ResponseBody + String uploadImage(HttpServletRequest request, HttpServletResponse response, HttpSession httpSession) + throws JSONException { + + JSONObject js = new JSONObject(); + js.put("Name", "Landmark Technologies"); + js.put("Calling Name", "Landmark"); + js.put("DOB", "08-Nov-2011"); + js.put("Hobbies", "Reading Technical Blogs,Teaching, Changing lives.."); + js.put("Places he like", "Africa, Church, His native place"); + + return js.toString(); +} +} diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 75b8c86e57..c62e24c6eb 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -1,23 +1,23 @@ - - - maven-web-application - - contextConfigLocation - /WEB-INF/mt-servlet.xml - - - mt - org.springframework.web.servlet.DispatcherServlet - 1 - - - mt - /services/* - - - org.springframework.web.context.ContextLoaderListener - - - /jsps/home.jsp - + + + maven-web-application + + contextConfigLocation + /WEB-INF/mt-servlet.xml + + + mt + org.springframework.web.servlet.DispatcherServlet + 1 + + + mt + /services/* + + + org.springframework.web.context.ContextLoaderListener + + + /jsps/home.jsp + \ No newline at end of file diff --git a/src/main/webapp/images/LANDMARK TECH LOGO 01 (3).png b/src/main/webapp/images/LANDMARK TECH LOGO 01 (3).png deleted file mode 100644 index a6cb0c25a9..0000000000 Binary files a/src/main/webapp/images/LANDMARK TECH LOGO 01 (3).png and /dev/null differ diff --git a/src/main/webapp/images/LANDMARK TECH LOGO 04.png b/src/main/webapp/images/LANDMARK TECH LOGO 04.png deleted file mode 100644 index fd3e413e6c..0000000000 Binary files a/src/main/webapp/images/LANDMARK TECH LOGO 04.png and /dev/null differ diff --git a/src/main/webapp/images/landmarklogo.jpg b/src/main/webapp/images/landmarklogo.jpg deleted file mode 100644 index c92d3078e0..0000000000 Binary files a/src/main/webapp/images/landmarklogo.jpg and /dev/null differ diff --git a/src/main/webapp/images/log4.png b/src/main/webapp/images/log4.png deleted file mode 100644 index 93244e99dd..0000000000 Binary files a/src/main/webapp/images/log4.png and /dev/null differ diff --git a/src/main/webapp/images/logo.JPG b/src/main/webapp/images/logo.JPG deleted file mode 100644 index 206b7bd356..0000000000 Binary files a/src/main/webapp/images/logo.JPG and /dev/null differ diff --git a/src/main/webapp/images/mithunlogo.jpg b/src/main/webapp/images/mithunlogo.jpg new file mode 100644 index 0000000000..4443345d01 Binary files /dev/null and b/src/main/webapp/images/mithunlogo.jpg differ diff --git a/src/main/webapp/images/mylandmarklogo.jpg b/src/main/webapp/images/mylandmarklogo.jpg deleted file mode 100644 index 3e5f7005ee..0000000000 Binary files a/src/main/webapp/images/mylandmarklogo.jpg and /dev/null differ diff --git a/src/main/webapp/images/log.png b/src/main/webapp/images/mylandmarklogo.png similarity index 100% rename from src/main/webapp/images/log.png rename to src/main/webapp/images/mylandmarklogo.png diff --git a/src/main/webapp/jsps/home.jsp b/src/main/webapp/jsps/home.jsp index 8a19925368..7c492794d4 100644 --- a/src/main/webapp/jsps/home.jsp +++ b/src/main/webapp/jsps/home.jsp @@ -1,39 +1,52 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -MylandmarkTech.com- Home Page - - - - -

Landmark Technologies

-

Welcome to Landmark Technology. - Landmark Technology is a an ideal online training platform for DevOps and Cloud Engineers. - We offer interview preparations and job assitance. - The shout of the King is in our midst. His name is JESUS. HE IS OUR SUCCESS ACCESS KEY

-
-
- - - - - Landmark Technology, - Toronto, Ontario, Canada - +1 437 215 2483, - mylandmarktech@gmail.com -
- Mail to Landmark Technologies -
-
-
-

Service : Get Employee Details

-
-
-

Landmark Technologies - Consultant, Training, Development Center.

-

Copyrights 2019 by Landmark Technologies

- - - +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ page import="java.net.*" %> + + + + +LandmarkTechnologies- Home Page + + + + +

Welcome to Landmark Software Solutions, Virginia, USA Office.

+

We are developing and supporting quality Software Solutions to millions of clients. + We offer Training for DevOps with Linux and Cloud equipping IT Engineers for best performance.

+
+
+

Server Side IP Address


+ +<% +String ip = ""; +InetAddress inetAddress = InetAddress.getLocalHost(); +ip = inetAddress.getHostAddress(); +out.println("Server Host Name :: "+inetAddress.getHostName()); +%> +
+<%out.println("Server IP Address :: "+ip);%> + + + +
+
+ + + + + Landmark Technology, + Toronto, Ontario, Canada + +1 437 215 2483, + mylandmarktech@gmail.com +
+ Mail to Landmark Technologies +
+
+
+

Service : Get Employee Details

+
+
+

Landmark Technologies - Consultant, Training and Software Development

+

Copyrights 2021 by Landmark Technologies

+ + +