diff --git a/Dockerfile b/Dockerfile index 74a00407b6..a282067035 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,2 @@ FROM tomcat:8.0.20-jre8 -# Dummy text to test -COPY target/maven-web-application*.war /usr/local/tomcat/webapps/maven-web-application.war +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/Jenkinsfile-sep23 b/Jenkinsfile-sep23 new file mode 100644 index 0000000000..2215249018 --- /dev/null +++ b/Jenkinsfile-sep23 @@ -0,0 +1,60 @@ +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_declarative_Sep24 b/Jenkinsfile_declarative_Sep24 new file mode 100644 index 0000000000..b1f7d43695 --- /dev/null +++ b/Jenkinsfile_declarative_Sep24 @@ -0,0 +1,60 @@ +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/pom.xml b/pom.xml index 3c18c3bbad..536b67a8c1 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:172.31.27.227:9000/ admin - admin + admin@123 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://172.31.18.29:8081/repository/ebay-bts-snapshot/ diff --git a/src/main/webapp/jsps/home.jsp b/src/main/webapp/jsps/home.jsp index 8a19925368..7bd0e8618c 100644 --- a/src/main/webapp/jsps/home.jsp +++ b/src/main/webapp/jsps/home.jsp @@ -9,15 +9,15 @@ -

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

+

Welcome to Landmark Technologies.

+

We are supporting the Ebay Black Friday Project. + Landmark Technologies is a software development company. + Class26 will run from October 2, 2021. + The shout of the King Jesus is in our midst. HE IS OUR SUCCESS ACCESS KEY


- + Landmark Technology, diff --git a/src/main/webapp/test/running notes/LinuxRunningNotes25.yml b/src/main/webapp/test/running notes/LinuxRunningNotes25.yml new file mode 100644 index 0000000000..3eef1b4cf7 --- /dev/null +++ b/src/main/webapp/test/running notes/LinuxRunningNotes25.yml @@ -0,0 +1,189 @@ +Linux Commands 1 : +======================= +PayPal = Client +======================== +Computers = +Operating system - OS + 80% Linux OS + 20% Windows OS + Solaris OS + Mac-OS + '' + Ownership of data center + Rent computing services + +We are leveraging computing serviceS from AWS and GCP + + Linus - 1991 + + + Linux OS = + + Is an Open source OS = Free + code + + WINDOWS --> Microsoft + Solaris --> Sun System + + +Linus was a student who converted a problem into a business + + Solaris wasn't an open source = paid for + + Create a free Account in AWS = + + https://aws.amazon.com/ + +CONNECTING TO LINUX SERVER IN AWS: + host: + PublicIP = 3.233.222.45 + Access the server from external Networks + privateIP = 172.31.8.197 + Access the server from internal Networks + VPN + authentication: + SSH-key = class25demo.pem = pem file + password = + + users details: + userName = ec2-user + = default user + + ssh-client Software : + mobaXterm or puTTY +Networking: + ssh ec2-user@3.233.222.45 = pasword + ssh landmark@3.233.222.45 + ssh -i class25demo.pem landmark@3.233.222.45 +ssh -i "class25demo.pem" ec2-user@ec2-3-233-222-45.compute-1.amazonaws.com + +Managing Files, Folders and sub Folders +In Linux folders = Directories +File structure in Linux : + / + = root (Main) + c: drive for Windows + /sbin /etc /tmp /lib /home /bin /opt + +home = users +=========== + - ec2-user + - simon + - landmark + - olu + - ade + +bin = binary files or commands +============================= +- cd = change Directory +- ls = list files and Directory +- cat = displays the content of a file +- pwd = present working directory +- whoami + +sbin = system bin +================= +- adduser simon +- useradd landmark +- passwd simon +- init 0 +users with elevated priviledges +What is the difference between bin and sbin in Linux? + sbin are binary flies only executable by users + with admin/elevated priviledges + bin files are executable by any user + + + CREATE FILES OR FOLDERS (Directory) + key.pem + test.txt + deploy.yml + hello.py + monitor.sh + ec2.tf + hello.java + pom.xml + + +LINUX SERVER = default files and directories + +etc = configuration files +======================== + - /etc/passwd + - /etc/shadow + - /etc/ssh/sshd_config + +tmp - temporal file holder +========================= + +opt = Install Softwares and Packages +=== + - maven + - tommcat + +lib = +==== + +proc +======= +- meminfo +- cpuinfo + +======================== + ls /bin + ls /sbin + ls /tmp + ls /opt + ls /var + ls /lib + ls /etc +sudo is use to escalate or elevate priviledges +Linux Basic Commands: +===================== + mkdir = create directory + ls = list fil and directories + mkdir class25 + mkdir devops + mkdir -v test + -v verbose + -p create both parent and child directories +textmate +mkdir -pv Devops/SDLC/Linux/Jenkins/Git/Maven/Nexus/ + + mkdir Devops/ + mkdir Devops/SDLC/ + mkdir Devops/SDLC/Linux/ + mkdir Devops/SDLC/Linux/Jenkins/ + mkdir Devops/SDLC/Linux/Jenkins/Git/ + mkdir Devops/SDLC/Linux/Jenkins/Git/Maven/ + mkdir Devops/SDLC/Linux/Jenkins/Git/Maven/Nexus/ + + tree + yum install tree + +Linux is case sensitive = + test / Test / TEST are different files in Linux + + mkdir -p devops/Linux/Jenkins/Git/Maven/Nexus/ + + mkdir -v test/ebay + + = tree cannot be found + + = yum install tree -- permission denied + + sudo yum install tree + +classes users: + Normal users + sudo adduser ade + sudo su - ade + Root / superuser / admin + system users + +rmdir it is use to delete empty directories + +mkdir use to create directories + +rm -r use to delete directories + +commands in Linux are in lower case \ No newline at end of file diff --git a/src/main/webapp/test/running notes/paypal.groovy b/src/main/webapp/test/running notes/paypal.groovy new file mode 100644 index 0000000000..661101c010 --- /dev/null +++ b/src/main/webapp/test/running notes/paypal.groovy @@ -0,0 +1,63 @@ +//Jenkins pipeline script +//Groovy script +node +{ +def mavenHome = tool name: 'maven3.6.3' +stage('1. CodeClone') +{ +git credentialsId: 'Github_credentials', url: 'https://github.com/myLandmakTechnology/maven-web-app.git' +} +stage('2. Build') +{ +sh "${mavenHome}/bin/mvn package -f boa.xml" +} + +stage('3. CodeQuality') +{ +sh "${mavenHome}/bin/mvn sonar:sonar" +} +stage('4.UploadNexus') +{ +sh "${mavenHome}/bin/mvn deploy" +} +stage('5. Approval') +{ +echo "Approved. Ready for deployment" +} +stage('6. DeployTomcat') +{ + +deploy adapters: [tomcat9(credentialsId: 'Tomcat-Credentials', path: '', url: 'http://54.163.156.108:8888/')], contextPath: null, war: 'target/*war' +} +stage('7. Notification') +{ +emailextrecipients([developers()]) +} +} + +stage('Deploy-prod'){ + steps{ + timeout(time:5, unit:'DAYS'){ + input message: 'Approval for production' + } + } + steps{ + deploy adapters: [tomcat9(credentialsId: 'Tomcat-Credentials', path: '', url: 'http://54.163.156.108:8888/')], contextPath: null, war: 'target/*war' + + } + } +} + + +node { + stage('clone'){ + steps{ + timeout(time:5, unit:'DAYS'){ + input message: 'Approval for clonning' + } + } + steps{ + git credentialsId: 'GitHUB-CREDENTIALS', url: 'https://github.com/Landmark-Technologies/maven-web-application' + } + } +}