diff --git a/Dockerfile b/Dockerfile index 74a00407b6..8ea23414f7 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 +FROM tomcat:9.0.91-jdk11-corretto +# author is Simon Legah of Landmark Technologies +COPY target/*.war /usr/local/tomcat/webapps/webapp.war diff --git a/Jenkinfile-dec-March2024 b/Jenkinfile-dec-March2024 new file mode 100644 index 0000000000..5f3806b780 --- /dev/null +++ b/Jenkinfile-dec-March2024 @@ -0,0 +1,96 @@ +pipeline{ + agent any + //options{} + //triggers{} + tools { + maven 'maven3.9.6' + } + stages{ + stage('1.CloneCode'){ + steps{ + sh "echo cloning the latest app version" + git 'https://github.com/LandmakTechnology/maven-web-application' + } + } + stage('2.mvnBuild'){ + steps{ + sh "echo validate, compile and perform UnitTesting" + sh "echo UnitTesting must passed for artifacts to be created" + sh "mvn clean package" + } +} + } +/* + stage('3.CodeQuality'){ + steps{ + //sh "mvn sonar:sonar" + sh "echo CodeQualityAnalysis completed" + } + + } + stage('4.UploadArtifacts'){ + steps{ + sh "mvn deploy" + sh "echo artifacts uploaded successfully" + sh "echo I am now a Build and Release Engineer" + sh "echo Build and release completed" + } + } + stage('5.Deploy2UAT'){ + steps{ + sh "echo Deployment is ready for the client review" + sh "echo using deploy to container plugin" + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://172.31.30.76:8080/')], contextPath: null, war: 'target/*war' + + } + } + + stage('6.ManualApproval'){ + steps{ + sh "echo Please Review and confirm within 5 days" + timeout(time:5, unit:'DAYS'){ + input message: 'Application ready for deployment, Please review and approve' + } + + } + } + stage('7.Deploy2Prod'){ + steps{ + sh "echo application reviewed, approved and ready for the market" + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://172.31.30.76:8080/')], contextPath: null, war: 'target/*war' + + } + } + } + post{ + always{ +emailext body: '''Hi Team, + +Build status. + +Landmark Technologies. +Tel: +1 437 215 2483 +''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build status', to: 'mylandmarktech@gmail.com' + } + success{ + emailext body: '''Hi Team, + +Build succeeded. + +Landmark Technologies. +Tel: +1 437 215 2483 +''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build status', to: 'mylandmarktech@gmail.com' + } + failure{ + emailext body: '''Hi Team, + +Build failed. + +Landmark Technologies. +Tel: +1 437 215 2483 +''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build status', to: 'mylandmarktech@gmail.com' + + } + } +*/ +} diff --git a/Jenkinsfile b/Jenkinsfile index 82d63ae784..c74562c10e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,54 +1,66 @@ -node - { - - def mavenHome = tool name: "maven3.6.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}" - - properties([[$class: 'JiraProjectProperty'], buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '2', daysToKeepStr: '', numToKeepStr: '2')), pipelineTriggers([pollSCM('* * * * *')])]) - - stage("CheckOutCodeGit") - { - git branch: 'development', credentialsId: '65fb834f-a83b-4fe7-8e11-686245c47a65', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git' - } - - stage("Build") - { - sh "${mavenHome}/bin/mvn clean package" - } - - /* - stage("ExecuteSonarQubeReport") - { - sh "${mavenHome}/bin/mvn sonar:sonar" - } - - stage("UploadArtifactsintoNexus") - { - sh "${mavenHome}/bin/mvn deploy" - } - - stage("DeployAppTomcat") - { - sshagent(['423b5b58-c0a3-42aa-af6e-f0affe1bad0c']) { - sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war ec2-user@15.206.91.239:/opt/apache-tomcat-9.0.34/webapps/" - } - } - - stage('EmailNotification') - { - mail bcc: 'devopstrainingblr@gmail.com', body: '''Build is over +pipeline{ + agent any + tools { + maven "maven3.6.0" + } + stages { + stage('1GetCode'){ + steps{ + sh "echo 'cloning the latest application version' " + git branch: 'feature', credentialsId: 'gitHubCredentials', url: 'https://github.com/LandmakTechnology/maven-web-application' + } + } + stage('3Test+Build'){ + steps{ + sh "echo 'running JUnit-test-cases' " + sh "echo 'testing must passed to create artifacts ' " + sh "mvn clean package" + } + } + /* + stage('4CodeQuality'){ + steps{ + sh "echo 'Perfoming CodeQualityAnalysis' " + sh "mvn sonar:sonar" + } + } + stage('5uploadNexus'){ + steps{ + sh "mvn deploy" + } + } + stage('8deploy2prod'){ + steps{ + deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war' + } + } +} + post{ + always{ + emailext body: '''Hey guys +Please check build status. - Thanks, - Mithun Technologies, - 9980923226.''', cc: 'devopstrainingblr@gmail.com', from: '', replyTo: '', subject: 'Build is over!!', to: 'devopstrainingblr@gmail.com' - } - */ - - } +Thanks +Landmark ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com' + } + success{ + emailext body: '''Hey guys +Good job build and deployment is successful. + +Thanks +Landmark ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com' + } + failure{ + emailext body: '''Hey guys +Build failed. Please resolve issues. + +Thanks +Landmark ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com' + } + } + */ +} +} diff --git a/Jenkinsfile-July2023 b/Jenkinsfile-July2023 new file mode 100644 index 0000000000..a33c60d98e --- /dev/null +++ b/Jenkinsfile-July2023 @@ -0,0 +1,26 @@ +node{ + def mavenHome = tool name: 'maven3.8.2' + stage('1Clone'){ + git 'https://github.com/LandmakTechnology/maven-web-application' + } + stage('2Test+build'){ + sh "${mavenHome}/bin/mvn clean package" + } +/* + stage('SonarQube'){ + sh "${mavenHome}/bin/mvn sonar:sonar" + } + stage('4UploadArtifacts'){ + sh "${mavenHome}/bin/mvn deploy" + } + + stage('5Deploy'){ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://54.166.85.32:8177/')], contextPath: null, war: 'target/*war' + } + stage('6Notification'){ + emailext body: '''Hi Team, +Build status +Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers' + } +*/ +} diff --git a/Jenkinsfile-Sep23-scripted b/Jenkinsfile-Sep23-scripted new file mode 100644 index 0000000000..0afb366cf7 --- /dev/null +++ b/Jenkinsfile-Sep23-scripted @@ -0,0 +1,55 @@ +node{ + def mavenHome = tool name: 'maven3.9.4' + stage('1.CloneCode'){ + //Jenkins running on a Linux system + //sh "git clone https://github.com/LandmakTechnology/maven-web-application" + git "https://github.com/LandmakTechnology/maven-web-application" + //Jenkins running on a windows system + //bat "git clone https://github.com/LandmakTechnology/maven-web-application" + } + stage('2.mvnBuild'){ + sh "${mavenHome}/bin/mvn clean package" + } + stage('3.CodeQuality'){ + //sh "${mavenHome}/bin/mvn sonar:sonar" + //edit pom.xml propertiesTAG with SonarQube server details + } + stage('4.UploadArtifacts'){ + //sh "${mavenHome}/bin/mvn deploy" + //edit pom.xml distributionManagement TAG with repository details + //edit settings.xml with nexus-user login credentials + } + stage('5.Deploy2UAT'){ + //use deploy-to-container plugin via pipeline syntax + //deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war' + //Deploying [/var/lib/jenkins/workspace/tesla-app-pipeline/target/tesla.war] + } + stage('6.6ManualApproval'){ + sh "echo 'Please review the application performance' " + //timeout(time:600, unit:'MINUTES') { + //input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7.Deploy2Prod'){ + sh "echo 'Deploy application to the customers/production' " + //deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war' + + } + stage('8.APM'){ + sh "echo 'monitoring and observation and alerting' " + sh "echo 'application performance Monitoring in progress' " + } + stage('9.emailNotification'){ + sh "echo 'notify the team for unusual accurances' " + sh "echo 'notify the team if the applications are down' " + sh "echo 'notify the team if the latency is higher that expected' " + emailext body: '''Hi Team, + +The build and Deployment status for tesla-app follows. + +Regards, +Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: 'mylandmarktech@gmail.com' + + } +} + diff --git a/Jenkinsfile-build23 b/Jenkinsfile-build23 new file mode 100644 index 0000000000..7febd4df18 --- /dev/null +++ b/Jenkinsfile-build23 @@ -0,0 +1,56 @@ +node{ + def mavenHome = tool name: 'maven3.9.4' + stage('1.CloneCode'){ + //Jenkins running on a Linux system + //sh "git clone https://github.com/LandmakTechnology/maven-web-application" + git "https://github.com/LandmakTechnology/maven-web-application" + //Jenkins running on a windows system + //bat "git clone https://github.com/LandmakTechnology/maven-web-application" + } + stage('2.mvnBuild'){ + sh "${mavenHome}/bin/mvn clean package" + } + /* + stage('3.CodeQuality'){ + //sh "${mavenHome}/bin/mvn sonar:sonar" + //edit pom.xml propertiesTAG with SonarQube server details + } + stage('4.UploadArtifacts'){ + sh "${mavenHome}/bin/mvn deploy" + //edit pom.xml distributionManagement TAG with repository details + //edit settings.xml with nexus-user login credentials + } + stage('5.Deploy2UAT'){ + //use deploy-to-container plugin via pipeline syntax + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war' + //Deploying [/var/lib/jenkins/workspace/tesla-app-pipeline/target/tesla.war] + } + stage('6.6ManualApproval'){ + sh "echo 'Please review the application performance' " + timeout(time:600, unit:'MINUTES') { + input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7.Deploy2Prod'){ + sh "echo 'Deploy application to the customers/production' " + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war' + + } + stage('8.APM'){ + sh "echo 'monitoring and observation and alerting' " + sh "echo 'application performance Monitoring in progress' " + } + */ + stage('9.emailNotification'){ + sh "echo 'notify the team for unusual accurances' " + sh "echo 'notify the team if the applications are down' " + sh "echo 'notify the team if the latency is higher that expected' " + emailext body: '''Hi Team, + +The build and Deployment status for tesla-app follows. + +Regards, +Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: 'mylandmarktech@gmail.com' + + } +} diff --git a/Jenkinsfile-declarative23 b/Jenkinsfile-declarative23 new file mode 100644 index 0000000000..ed81fea356 --- /dev/null +++ b/Jenkinsfile-declarative23 @@ -0,0 +1,65 @@ +pipeline{ + agent any + tools { + maven "maven3.8.2" + } + //options {} + //triggers {} + stages{ + stage('1clone'){ + steps{ + sh "echo ready to automate build" + git 'https://github.com/LandmakTechnology/maven-web-application' + sh "echo latest application version collected from SCM" + } + } + stage('2build'){ + steps{ + sh "echo build process starts " + sh "mvn clean package" + sh "echo build process ends" + } + } + + stage('3review'){ + steps{ + sh "echo CodeQuality review starts " + sh "mvn sonar:sonar" + sh "echo CodeQuality review ends" + } + } + stage('4UploadArtifacts'){ + steps{ + sh "mvn deploy" + sh "echo build and release job completed successfully" + } + } + stage('5deployment'){ + steps{ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://54.166.85.32:8177/')], contextPath: null, war: 'target/*war' + sh "echo deployment to production completed successfully" + } + } + } + post{ + failure{ + emailext body: '''Hi Team, +Build failed +Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers' + + } + success{ + emailext body: '''Hi Team, +Build succeeded +Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers' + + } + always{ + emailext body: '''Hi Team, +Build status +Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers' + + } + } + +} 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/Jenkinsfile-sep23-decl b/Jenkinsfile-sep23-decl new file mode 100644 index 0000000000..3788529001 --- /dev/null +++ b/Jenkinsfile-sep23-decl @@ -0,0 +1,81 @@ +pipeline{ + agent any + tools{ + maven 'maven3.9.4' + } + //options{} + //triggers{} + stages{ + stage('1.CloneCode'){ + steps{ + sh "echo 'cloning the latest application version' " + git "https://github.com/LandmakTechnology/maven-web-application" + } + } + stage('2.mvnBuild'){ + steps{ + sh "echo 'running JUnit-test-cases' " + sh "echo 'testing must passed to create artifacts ' " + sh "mvn clean package" + } + } + stage('3.CodeQuality'){ + steps{ + sh "echo 'Perfoming CodeQualityAnalysis' " + //sh "mvn sonar:sonar" + } + } + stage('4.UploadArtifacts'){ + steps{ + sh "mvn deploy" + } + } + stage('5.Deploy2UAT'){ + steps{ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war' + } + } + stage('6.ManualApproval'){ + steps{ + sh "echo 'Please review the application performance' " + timeout(time:600, unit:'MINUTES') { + input message: 'Application ready for deployment, Please review and approve' + } + } + } + stage('7.Deploy2Prod'){ + steps{ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war' + } + } + } + post{ + always{ + emailext body: '''Hi Team, + + The build and Deployment status for is a success. + + Regards, + Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: 'mylandmarktech@gmail.com' + + } + success{ + emailext body: '''Hi Team, + + The build and Deployment is a success. + + Regards, + Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: 'mylandmarktech@gmail.com' + + } + failure{ + emailext body: '''Hi Team, + + The build and Deployment failed. + + Regards, + Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: 'mylandmarktech@gmail.com' + + } + } +} diff --git a/Jenkinsfile11 b/Jenkinsfile11 new file mode 100644 index 0000000000..f393b56cb2 --- /dev/null +++ b/Jenkinsfile11 @@ -0,0 +1,54 @@ +node + { + + def mavenHome = tool name: "maven3.6.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}" + + properties([[$class: 'JiraProjectProperty'], buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '2', daysToKeepStr: '', numToKeepStr: '2')), pipelineTriggers([pollSCM('* * * * *')])]) + + stage("CheckOutCodeGit") + { + git branch: 'development', credentialsId: '65fb834f-a83b-4fe7-8e11-686245c47a65', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git' + } + + stage("Build") + { + sh "${mavenHome}/bin/mvn clean package" + } + + /* + stage("ExecuteSonarQubeReport") + { + sh "${mavenHome}/bin/mvn sonar:sonar" + } + + stage("UploadArtifactsintoNexus") + { + sh "${mavenHome}/bin/mvn deploy" + } + + stage("DeployAppTomcat") + { + sshagent(['423b5b58-c0a3-42aa-af6e-f0affe1bad0c']) { + sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war ec2-user@15.206.91.239:/opt/apache-tomcat-9.0.34/webapps/" + } + } + + stage('EmailNotification') + { + mail bcc: 'mylandmarktech@gmail.com', body: '''Build is over + + Thanks, + Landmark Technologies, + +14372152483.''', cc: 'mylandmarktech@gmail.com', from: '', replyTo: '', subject: 'Build is over!!', to: 'mylandmarktech@gmail.com' + } + */ + + } diff --git a/Jenkinsfile24 b/Jenkinsfile24 new file mode 100644 index 0000000000..357d9ecfff --- /dev/null +++ b/Jenkinsfile24 @@ -0,0 +1,59 @@ +pipeline{ + agent any + tools{ + maven 'maven3.9.9' + } + stages{ + stage('1.GitClone'){ + steps{ + sh "echo cloning the latest app version" + git 'https://github.com/LandmakTechnology/maven-web-application' + } + } + stage('2.mavenbuild'){ + steps{ + sh "echo creating deployanle packages" + sh 'mvn clean package' + } + } +/* + stage('3.CodeQuality'){ + steps{ + sh "mvn sonar:sonar" + sh "echo CodeQualityAnalysis completed" + } + } + stage('4.UploadArtifacts'){ + steps{ + sh "mvn deploy" + sh "echo artifacts uploaded successfully" + sh "echo I am now a Build and Release Engineer" + sh "echo Build and release completed" + } + } +stage('5.Deploy2UAT'){ + steps{ + sh "echo Deployment is ready for the client review" + sh "echo using deploy to container plugin" + } + } + stage('6approval'){ + steps{ + sh "echo Deployment is ready for the client review" + sh "echo using deploy to container plugin" + echo "ready for inspection" + timeout(time:5, unit:'DAYS'){ + input message: 'Application ready for deployment, Please review and approve' + } + } + } +*/ +stage('7.Deploy2Prod'){ + steps{ + sh "echo application reviewed, approved and ready for the market" + emailext body: 'Hello Review and approve. ', subject: 'success', to: 'mylandmarktech@gmail.com' + } +} + } + +} diff --git a/Jenkinsfile34 b/Jenkinsfile34 new file mode 100644 index 0000000000..d607ad7dc5 --- /dev/null +++ b/Jenkinsfile34 @@ -0,0 +1,47 @@ +node{ + def mavenHome = tool name: 'maven3.9.6' + stage('1.clonecode'){ + git "https://github.com/LandmakTechnology/maven-web-application" + } + stage('2.mavenBuild'){ + sh "${mavenHome}/bin/mvn package" + } + /* + stage('3.codeQualityAnalysis'){ + sh "${mavenHome}/bin/mvn sonar:sonar" + } + + stage('4.uploadArtifacts'){ + sh "${mavenHome}/bin/mvn deploy" + } + stage('5.deploy2UAT'){ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://3.144.85.2:8088/')], contextPath: null, war: 'target/*war' + + } + stage('6.ManualApproval'){ + sh " echo 'Please review & approve' " + timeout(time:300, unit:'MINUTES') + { + input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7.deploy2prod'){ + //use deploy to container plugin + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://3.144.85.2:8088/')], contextPath: null, war: 'target/*war' + + } + stage('8.apm'){ + sh "echo 'monitoring and observation and alerting' " + sh "echo 'application performance Monitoring in progress' " + } + stage('9.notification'){ + sh "echo create email notification to resolve any issue that may arise" + //use pipeline syntax and email notification plugin to achieve this + emailext body: '''The build and Deployment status for tesla-webapp. + +Regards, +Landmark Technologies''', recipientProviders: [developers(), upstreamDevelopers(), buildUser()], subject: 'job status', to: 'mylandmarktech@gmail.com' + + } +*/ +} 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_Dec2023 b/Jenkinsfile_Dec2023 new file mode 100644 index 0000000000..d26e33bf7f --- /dev/null +++ b/Jenkinsfile_Dec2023 @@ -0,0 +1,48 @@ +node{ + def mavenHome = tool name: 'maven3.9.6' + stage('1.clonecode'){ + git "https://github.com/LandmakTechnology/maven-web-application" + } + stage('2.mavenBuild'){ + sh "${mavenHome}/bin/mvn package" + } +/* + stage('3.codeQualityAnalysis'){ + sh "${mavenHome}/bin/mvn sonar:sonar" + } + + stage('4.uploadArtifacts'){ + sh "${mavenHome}/bin/mvn deploy" + } + stage('5.deploy2UAT'){ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://3.144.85.2:8088/')], contextPath: null, war: 'target/*war' + + } + stage('6.ManualApproval'){ + sh " echo 'Please review & approve' " + timeout(time:300, unit:'MINUTES') + { + input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7.deploy2prod'){ + //use deploy to container plugin + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://3.144.85.2:8088/')], contextPath: null, war: 'target/*war' + + } +*/ + stage('8.apm'){ + sh "echo 'monitoring and observation and alerting' " + sh "echo 'application performance Monitoring in progress' " + } + stage('9.notification'){ + sh "echo create email notification to resolve any issue that may arise" + //use pipeline syntax and email notification plugin to achieve this + emailext body: '''The build and Deployment status for tesla-webapp. + +Regards, +Landmark Technologies''', recipientProviders: [developers(), upstreamDevelopers(), buildUser()], subject: 'job status', to: 'mylandmarktech@gmail.com' + + } + +} diff --git a/Jenkinsfile_June2024 b/Jenkinsfile_June2024 new file mode 100644 index 0000000000..ec50154acd --- /dev/null +++ b/Jenkinsfile_June2024 @@ -0,0 +1,45 @@ +node{ + def mavenHome = tool name: 'maven3.9.7' + stage('1.GitClone'){ + git "https://github.com/LandmakTechnology/maven-web-application" +} + stage('2.mavenBuild'){ + sh "${mavenHome}/bin/mvn package" + } + stage('3.sonaqubeQuality'){ + sh "${mavenHome}/bin/mvn sonar:sonar" + } + stage('4.UploadArtifacts'){ + //sh "${mavenHome}/bin/mvn deploy" + sh "echo The build and release job is ended" + } + stage('5.deploy2UAT'){ + sh "echo deployment launched using deploy2container plugin" +deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://54.152.168.210:8088/')], contextPath: null, war: 'target/*war' + + } + stage('6.ManualApproval'){ + sh " echo 'Please review & approve' " + timeout(time:3, unit:'HOURS') + { + input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7.deploy2prod'){ + sh "echo deployment launched to production" +deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://54.152.168.210:8088/')], contextPath: null, war: 'target/*war' + + } +stage('8.apm'){ + sh "echo 'monitoring, observation and alerting' " + sh "echo 'application performance Monitoring in progress' " +} + stage('9.notification'){ + emailext body: '''The build and Deployment status for tesla-webapp. + +Regards, +Landmark Technologies''', recipientProviders: [developers(), upstreamDevelopers(), buildUser()], subject: 'job status', to: 'mylandmarktech@gmail.com' + + } + +} diff --git a/Jenkinsfile_March2023 b/Jenkinsfile_March2023 new file mode 100644 index 0000000000..23c0f094e8 --- /dev/null +++ b/Jenkinsfile_March2023 @@ -0,0 +1,36 @@ +node{ + def mavenHome = tool name: 'maven3.9.1' + stage('1.CodeClone'){ + git credentialsId: 'gitHubCredentials', url: 'https://github.com/LandmakTechnology/maven-web-application' + } + stage('2MavenBuild'){ + sh "${mavenHome}/bin/mvn package" + } + /* + stage('3codeQuality'){ + sh "${mavenHome}/bin/mvn sonar:sonar" + } + stage('4UploadArtifacts'){ + sh "${mavenHome}/bin/mvn deploy" + } + stage('5deploy2UAT'){ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://100.26.217.86:8080/')], contextPath: null, war: 'target/*war' + } + stage('6Manualapproval'){ + sh "echo 'ready for review' " + timeout(time:5, unit:'HOURS') { + input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7deploy2Prod'){ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://100.26.217.86:8080/')], contextPath: null, war: 'target/*war' + } + stage('8emailNotify'){ + emailext body: '''Hello Team, + +Build is done. + +LANDMARKTECH''', recipientProviders: [developers(), contributor(), upstreamDevelopers()], subject: 'Build Status', to: 'mylandmarktech@gmail.com' + } + */ +} diff --git a/Jenkinsfile_declarative042023 b/Jenkinsfile_declarative042023 new file mode 100644 index 0000000000..9cde454050 --- /dev/null +++ b/Jenkinsfile_declarative042023 @@ -0,0 +1,69 @@ +pipeline{ + agent { + label 'master' + } + tools { + maven 'maven3.9.1' + } + //options{} + //triggers{} + stages { + stage('1Clone'){ + steps{ + sh "echo 'cloning the latest application version' " + git "https://github.com/LandmakTechnology/maven-web-application" + sh "echo 'latest application version available for testing and build' " + } + } + stage('2TestBuild'){ + steps{ + sh "echo 'running JUnit-test-cases' " + sh "echo 'testing must passed to create artifacts ' " + sh "mvn clean package" + } + } + stage('3CodeQualityAnalysis') { + steps{ + sh "echo setup sonarQube authentication" + sh "echo 'Perfoming CodeQualityAnalysis' " + sh "mvn sonar:sonar" + } + } + stage('4UploadArtifacts') { + steps{ + sh "echo configure nexus authentication" + //sh "mvn deploy" + sh "echo artifacts uploaded" + } + } + stage('5deploy') { + steps{ + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://100.26.217.86:8080/')], contextPath: null, war: 'target/*war' + } + } + + //stage('5deploy') {} + } +post{ + always{ +emailext body: '''Great job team. + +LandmarkTech ''', recipientProviders: [buildUser(), developers()], subject: 'Build Success', to: 'mylandmarktech@gmail.com' + + } + success{ +emailext body: '''Great job team. + +LandmarkTech ''', recipientProviders: [buildUser(), developers()], subject: 'Build Success', to: 'mylandmarktech@gmail.com' + + } + failure{ +emailext body: '''Please review this job. + +LandmarkTech ''', recipientProviders: [buildUser(), developers()], subject: 'Build failed', to: 'mylandmarktech@gmail.com' + + } + +} + +} diff --git a/Jenkinsfile_declarativeDec2023 b/Jenkinsfile_declarativeDec2023 new file mode 100644 index 0000000000..96300b6d21 --- /dev/null +++ b/Jenkinsfile_declarativeDec2023 @@ -0,0 +1,88 @@ +pipeline{ + agent any + //options{} + //triggers{} + tools { + maven 'maven3.9.6' + } + stages{ + stage('1clonecode'){ + steps{ + git "https://github.com/LandmakTechnology/maven-web-application" + } + } + stage('2mavenBuild'){ + steps{ + sh "echo 'running JUnit-test-cases' " + sh "echo 'testing must passed to create artifacts ' " + sh "mvn clean package" + } + } + stage('3CodeQuality'){ + steps{ + // sh "mvn sonar:sonar" + sh "echo CodeQualityAnalysis completed" + } + } + stage('4UploadArtifacts'){ + steps{ + //sh "mvn deploy" + sh "echo artifacts uploaded successfully" + sh "echo I am now a Build and Release Engineer" + sh "echo Build and release completed" + } + } + stage('5deploy2UAT'){ + steps{ + sh "echo Deployment is ready for the client review" + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://10.0.0.38:8088/')], contextPath: null, war: 'target/*war ' + + } + } + stage('6manualApproval'){ + steps{ + sh "echo Review the application and confirm its performance within 5 hours" + timeout(time:5, unit:'HOURS') { + input message: 'Application ready for deployment, Please review and approve' + } + } + } + stage('7deploy2prod'){ + steps{ + sh "echo application reviewed, approved and ready for the market" + deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://10.0.0.38:8088/')], contextPath: null, war: 'target/*war ' + + } + } + } + post{ + always{ + emailext body: '''Hi, + +Build status. + +Landmark Technologies. +Tel: +1 437 215 2483''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: 'mylandmarktech@gmail.com' + + } + success { + emailext body: '''Hi, + +Build successful. + +Landmark Technologies. +Tel: +1 437 215 2483''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: 'mylandmarktech@gmail.com' + + } + failure{ + emailext body: '''Hi, + +Build failed. + +Landmark Technologies. +Tel: +1 437 215 2483''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', 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/Jenkinsfile_paypal28 b/Jenkinsfile_paypal28 new file mode 100644 index 0000000000..9a6b8f88b4 --- /dev/null +++ b/Jenkinsfile_paypal28 @@ -0,0 +1,37 @@ +node{ + def mavenHome = tool name: 'maven3.8.6' + stage('1cloneCode'){ + sh "echo running a software build and deployment project for payPal" + git "https://github.com/LandmakTechnology/maven-web-application" + } + stage('2Test&Build'){ + sh "${mavenHome}/bin/mvn install" + } + /* + stage('3CodeQuality'){ + sh "${mavenHome}/bin/mvn sonar:sonar" + } + stage('4UploadArtifacts'){ + sh "${mavenHome}/bin/mvn deploy" + } + stage('5deploy_uat'){ + //sh "scp " + deploy adapters: [tomcat9(credentialsId: 'tomcatCredentials', path: '', url: 'http://18.119.10.206:8080/')], contextPath: null, war: 'target/*war' + } + stage('6Approval'){ + timeout(time:9, unit:'HOURS') { + input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7deploy_prod'){ + deploy adapters: [tomcat9(credentialsId: 'tomcatCredentials', path: '', url: 'http://18.119.10.206:8080/')], contextPath: null, war: 'target/*war' + } + stage('8Notification'){ + // Pipeline Syntax + emailext body: '''Build status for frontend application. + +Regards, +Landmark Technologies''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build Status', to: 'paypal-team@gmail.com' + } +*/ +} diff --git a/Jenkinsfile_sep22 b/Jenkinsfile_sep22 new file mode 100644 index 0000000000..c22bd4d45b --- /dev/null +++ b/Jenkinsfile_sep22 @@ -0,0 +1,43 @@ +node{ + def mavenHome = tool name: 'maven3.8.6' + stage('1cloneCode'){ + git "https://github.com/LandmakTechnology/maven-web-application" + } + stage('2Test&Build'){ + sh "${mavenHome}/bin/mvn clean package" + //bat "${mavenHome}/bin/mvn clean package" + } + /* + stage('3codeQuality'){ + sh "${mavenHome}/bin/mvn sonar:sonar" + } + stage('4uploadArtifacts'){ + //sh "${mavenHome}/bin/mvn deploy" + //http://52.53.227.31:8191/landmark/repository/tesla-fe-snapshots/ + //http://52.53.227.31:8191/landmark/repository/tesla-fe-releases/ + // vi pom.xml and added repository details + // vi setting.xml and add AUTHENTICATION details + } + stage('5deploy2UAT'){ + sh "echo 'deploy to UAT' " + deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war' + } + stage('6approvalGate'){ + sh "echo 'ready for review' " + timeout(time:5, unit:'DAYS') { + input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7deploy2Prod'){ + sh "sleep 50" + deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war' + } + stage('8emailNotification'){ + emailext body: '''Hi All, + +Check Build status. + +Landmark Technologies''', recipientProviders: [buildUser(), developers(), upstreamDevelopers(), brokenBuildSuspects(), brokenTestsSuspects(), contributor()], subject: 'build status', to: 'tesla-app@gmail.com' + } + */ +} diff --git a/Jenkinsfile_tesla b/Jenkinsfile_tesla new file mode 100644 index 0000000000..07e14149b7 --- /dev/null +++ b/Jenkinsfile_tesla @@ -0,0 +1,41 @@ +node{ + def mavenHome = tool name: 'maven3.8.6' + stage('1cloneCode'){ + git "https://github.com/LandmakTechnology/maven-web-application" + } + stage('2Test&Build'){ + sh "${mavenHome}/bin/mvn clean package" + //bat "${mavenHome}/bin/mvn clean package" + } + stage('3codeQuality'){ + sh "${mavenHome}/bin/mvn sonar:sonar" + } + stage('4uploadArtifacts'){ + //sh "${mavenHome}/bin/mvn deploy" + //http://52.53.227.31:8191/landmark/repository/tesla-fe-snapshots/ + //http://52.53.227.31:8191/landmark/repository/tesla-fe-releases/ + // vi pom.xml and added repository details + // vi setting.xml and add AUTHENTICATION details + } + stage('5deploy2UAT'){ + sh "echo 'deploy to UAT' " + deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war' + } + stage('6approvalGate'){ + sh "echo 'ready for review' " + timeout(time:5, unit:'DAYS') { + input message: 'Application ready for deployment, Please review and approve' + } + } + stage('7deploy2Prod'){ + sh "sleep 50" + deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war' + } + stage('8emailNotification'){ + emailext body: '''Hi All, + +Check Build status. + +Landmark Technologies''', recipientProviders: [buildUser(), developers(), upstreamDevelopers(), brokenBuildSuspects(), brokenTestsSuspects(), contributor()], subject: 'build status', to: 'tesla-app@gmail.com' + } +} 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/Jenkinsfiles-declarative29 b/Jenkinsfiles-declarative29 new file mode 100644 index 0000000000..19a825e376 --- /dev/null +++ b/Jenkinsfiles-declarative29 @@ -0,0 +1,63 @@ +pipeline{ + agent any + tools { + maven "maven3.6.0" + } + stages { + stage('1GetCode'){ + steps{ + sh "echo 'cloning the latest application version' " + git branch: 'feature', credentialsId: 'gitHubCredentials', url: 'https://github.com/LandmakTechnology/maven-web-application' + } + } + stage('3Test+Build'){ + steps{ + sh "echo 'running JUnit-test-cases' " + sh "echo 'testing must passed to create artifacts ' " + sh "mvn clean package" + } + } + stage('4CodeQuality'){ + steps{ + sh "echo 'Perfoming CodeQualityAnalysis' " + sh "mvn sonar:sonar" + } + } + stage('5uploadNexus'){ + steps{ + sh "mvn deploy" + } + } + stage('8deploy2prod'){ + steps{ + deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war' + } + } +} + post{ + always{ + emailext body: '''Hey guys +Please check build status. + +Thanks +Landmark ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com' + } + success{ + emailext body: '''Hey guys +Good job build and deployment is successful. + +Thanks +Landmark ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com' + } + failure{ + emailext body: '''Hey guys +Build failed. Please resolve issues. + +Thanks +Landmark ++1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com' + } + } +} diff --git a/deploy-k8s.yml b/deploy-k8s.yml new file mode 100644 index 0000000000..fa59f3848a --- /dev/null +++ b/deploy-k8s.yml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webapp +spec: + selector: + matchLabels: + app: myapp + template: + metadata: + labels: + app: myapp + spec: + containers: + - name: myapp + image: mylandmarktech/maven-web-app + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: + name: myapp +spec: + type: NodePort + selector: + app: myapp + ports: + - port: 80 + targetPort: 8080 + nodePort: 30300 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 240a0c2841..82a1f6972d 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,12 @@ 4.0.0 - + com.mt maven-web-application war - 0.0.1-SNAPSHOT + + 0.0.2-SNAPSHOT maven-web-application @@ -16,18 +17,17 @@ http://landmarktechnologies.com/ - - 1.8 - 5.1.2.RELEASE - 4.11 - 1.2.17 - http:3.96.196.171:9000/ - admin - admin - UTF-8 - UTF-8 - - + + 1.8 + 5.1.2.RELEASE + 4.11 + 1.2.17 + http://http://52.14.163.222:9000/ + admin + admin123 + UTF-8 + UTF-8 + @@ -89,28 +89,26 @@ javax.servlet-api 3.1.0 provided - - - - - - - - nexus - Landmark Technologies Releases Nexus Repository - http://35.174.19.3:8081/repository/amazon-release/ - - - - nexus - Landmark Technologies Snapshot Nexus Repository - http://35.174.19.3:8081/repository/amazon-snapshot/ - - - + + + + + + nexus + Landmark Technologies Releases Nexus Repository + http://98.81.159.237:8081/repository/tesla-releases/ + + + + nexus + Landmark Technologies Snapshot Nexus Repository + http://98.81.159.237:8081/repository/tesla-snapshots/ + + + - Landmark + tesla 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/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/mithunlogo.jpg b/src/main/webapp/images/mithunlogo.jpg deleted file mode 100644 index 4443345d01..0000000000 Binary files a/src/main/webapp/images/mithunlogo.jpg and /dev/null 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/mylandmarklogo.png b/src/main/webapp/images/mylandmarklogo.png new file mode 100644 index 0000000000..3e01fb9b38 Binary files /dev/null and b/src/main/webapp/images/mylandmarklogo.png differ diff --git a/src/main/webapp/jsps/home.jsp b/src/main/webapp/jsps/home.jsp index d3c9470330..63d8de04c9 100644 --- a/src/main/webapp/jsps/home.jsp +++ b/src/main/webapp/jsps/home.jsp @@ -1,44 +1,58 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Mylandmark.Tech- Home Page - - - - -

Landmark Technology --> A Metropolitan University Company

-

Welcome to Landmark Technology.......We have a demo on DevOps E Degree with Linux and AWS on Saturday August 5, 2020 at 4pm EST for our new batch. - Landmark Technology is a an ideal online training platform for DevOps and Cloud Infrastructures. - Our anointed and extensive teaching approach takes our students with or without any IT Background to become Subject Matter Expect in IT, and DevOps automation. - Over 80% of our students are hired within 6 months of joining Landmark Technology. - Congratulations!! Welcome to Landmark Technology!! Welcome to your ENVIABLE IT CAREER. - We offer interview preparations and job assitance. - The King is in our midst. His name is JESUS. What a wonderful it is. HE IS OUR SUCCESS ACCESS KEY. - Thanks for being an ambassador of Landmark Technology. President

-
-
- - - - - Landmark Technology, - Toronto, Ontario, Canada - Dallas, TX USA, - +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 Tesla Web application Project.

+

Landmark Software Solutions (LSS) are developing and supporting quality Software Solutions to millions of clients globally. + We are raising billionaires IT professionals accross the nations of the World. + Landmark Software Solutions (LSS) offers Training for DevOps with Linux, Kubernetes and Cloud, equipping IT Engineers for best performance. + Landmark Technologies, the Pride of Africa. + Class37 DevOps MasterClass started on July 13, 2024. + Class38 DevOps MasterClass will start on Oct 19, 2024. + Please invite all your contacts and friends for this life changing course. +

+
+
+

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, 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

+ + + diff --git a/tesla.xml b/tesla.xml new file mode 100644 index 0000000000..7685969acf --- /dev/null +++ b/tesla.xml @@ -0,0 +1,151 @@ + + 4.0.0 + + com.mt + maven-web-application + war + + 0.0.2-SNAPSHOT + + maven-web-application + + Maven Web Project for Java Project + + + Landmark Technologies + http://landmarktechnologies.com/ + + + + 1.8 + 5.1.2.RELEASE + 4.11 + 1.2.17 + http://10.0.0.124:9000/ + admin + admin + UTF-8 + UTF-8 + + + + + + org.json + json + 20160212 + + + + + junit + junit + 3.8.1 + test + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + org.mockito + mockito-core + 1.9.5 + test + + + + + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + org.springframework + spring-webmvc + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + + nexus + Landmark Technologies Releases Nexus Repository + http://3.137.166.218:8081/repository/tesla-releases/ + + + + nexus + Landmark Technologies Snapshot Nexus Repository + http://3.137.166.218:8081/repository/tesla-snapshots/ + + + + + + tesla + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + ${jdk.version} + ${jdk.version} + + + + + org.eclipse.jetty + jetty-maven-plugin + 9.2.11.v20150529 + + 10 + + /maven-web-application + + + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.9 + + true + true + 2.0 + maven-web-application + + + + + + + +