├── Dockerfile
├── Jenkinfile-dec-March2024
├── Jenkinsfile
├── Jenkinsfile-July2023
├── Jenkinsfile-Sep23-scripted
├── Jenkinsfile-build23
├── Jenkinsfile-declarative23
├── Jenkinsfile-ebay
├── Jenkinsfile-sep23-decl
├── Jenkinsfile11
├── Jenkinsfile24
├── Jenkinsfile34
├── Jenkinsfile39scripted
├── JenkinsfileDeclarative
├── JenkinsfileJuly2021
├── Jenkinsfile_Dec2023
├── Jenkinsfile_June2024
├── Jenkinsfile_March2023
├── Jenkinsfile_dec_April2025
├── Jenkinsfile_declarative042023
├── Jenkinsfile_declarativeDec2023
├── Jenkinsfile_docker
├── Jenkinsfile_paypal28
├── Jenkinsfile_sep22
├── Jenkinsfile_tesla
├── JenkinsfiledeclarativeJuneBathc
├── Jenkinsfiles-declarative29
├── deploy-k8s.yml
├── docker-compose.yml
├── pom.xml
├── src
└── main
│ ├── java
│ └── com
│ │ └── mt
│ │ └── services
│ │ └── EmployeeService.java
│ └── webapp
│ ├── WEB-INF
│ ├── mt-servlet.xml
│ └── web.xml
│ ├── images
│ └── mylandmarklogo.png
│ └── jsps
│ └── home.jsp
└── tesla.xml
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM tomcat:9.0.91-jdk11-corretto
2 | # author is Simon Legah of Landmark Technologies
3 | COPY target/*.war /usr/local/tomcat/webapps/webapp.war
4 |
--------------------------------------------------------------------------------
/Jenkinfile-dec-March2024:
--------------------------------------------------------------------------------
1 | pipeline{
2 | agent any
3 | //options{}
4 | //triggers{}
5 | tools {
6 | maven 'maven3.9.6'
7 | }
8 | stages{
9 | stage('1.CloneCode'){
10 | steps{
11 | sh "echo cloning the latest app version"
12 | git 'https://github.com/LandmakTechnology/maven-web-application'
13 | }
14 | }
15 | stage('2.mvnBuild'){
16 | steps{
17 | sh "echo validate, compile and perform UnitTesting"
18 | sh "echo UnitTesting must passed for artifacts to be created"
19 | sh "mvn clean package"
20 | }
21 | }
22 | }
23 | /*
24 | stage('3.CodeQuality'){
25 | steps{
26 | //sh "mvn sonar:sonar"
27 | sh "echo CodeQualityAnalysis completed"
28 | }
29 |
30 | }
31 | stage('4.UploadArtifacts'){
32 | steps{
33 | sh "mvn deploy"
34 | sh "echo artifacts uploaded successfully"
35 | sh "echo I am now a Build and Release Engineer"
36 | sh "echo Build and release completed"
37 | }
38 | }
39 | stage('5.Deploy2UAT'){
40 | steps{
41 | sh "echo Deployment is ready for the client review"
42 | sh "echo using deploy to container plugin"
43 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://172.31.30.76:8080/')], contextPath: null, war: 'target/*war'
44 |
45 | }
46 | }
47 |
48 | stage('6.ManualApproval'){
49 | steps{
50 | sh "echo Please Review and confirm within 5 days"
51 | timeout(time:5, unit:'DAYS'){
52 | input message: 'Application ready for deployment, Please review and approve'
53 | }
54 |
55 | }
56 | }
57 | stage('7.Deploy2Prod'){
58 | steps{
59 | sh "echo application reviewed, approved and ready for the market"
60 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://172.31.30.76:8080/')], contextPath: null, war: 'target/*war'
61 |
62 | }
63 | }
64 | }
65 | post{
66 | always{
67 | emailext body: '''Hi Team,
68 |
69 | Build status.
70 |
71 | Landmark Technologies.
72 | Tel: +1 437 215 2483
73 | ''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build status', to: 'mylandmarktech@gmail.com'
74 | }
75 | success{
76 | emailext body: '''Hi Team,
77 |
78 | Build succeeded.
79 |
80 | Landmark Technologies.
81 | Tel: +1 437 215 2483
82 | ''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build status', to: 'mylandmarktech@gmail.com'
83 | }
84 | failure{
85 | emailext body: '''Hi Team,
86 |
87 | Build failed.
88 |
89 | Landmark Technologies.
90 | Tel: +1 437 215 2483
91 | ''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build status', to: 'mylandmarktech@gmail.com'
92 |
93 | }
94 | }
95 | */
96 | }
97 |
--------------------------------------------------------------------------------
/Jenkinsfile:
--------------------------------------------------------------------------------
1 | pipeline{
2 | agent any
3 | tools {
4 | maven "maven3.6.0"
5 | }
6 | stages {
7 | stage('1GetCode'){
8 | steps{
9 | sh "echo 'cloning the latest application version' "
10 | git branch: 'feature', credentialsId: 'gitHubCredentials', url: 'https://github.com/LandmakTechnology/maven-web-application'
11 | }
12 | }
13 | stage('3Test+Build'){
14 | steps{
15 | sh "echo 'running JUnit-test-cases' "
16 | sh "echo 'testing must passed to create artifacts ' "
17 | sh "mvn clean package"
18 | }
19 | }
20 | /*
21 | stage('4CodeQuality'){
22 | steps{
23 | sh "echo 'Perfoming CodeQualityAnalysis' "
24 | sh "mvn sonar:sonar"
25 | }
26 | }
27 | stage('5uploadNexus'){
28 | steps{
29 | sh "mvn deploy"
30 | }
31 | }
32 | stage('8deploy2prod'){
33 | steps{
34 | deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war'
35 | }
36 | }
37 | }
38 | post{
39 | always{
40 | emailext body: '''Hey guys
41 | Please check build status.
42 |
43 | Thanks
44 | Landmark
45 | +1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com'
46 | }
47 | success{
48 | emailext body: '''Hey guys
49 | Good job build and deployment is successful.
50 |
51 | Thanks
52 | Landmark
53 | +1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com'
54 | }
55 | failure{
56 | emailext body: '''Hey guys
57 | Build failed. Please resolve issues.
58 |
59 | Thanks
60 | Landmark
61 | +1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com'
62 | }
63 | }
64 | */
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Jenkinsfile-July2023:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven3.8.2'
3 | stage('1Clone'){
4 | git 'https://github.com/LandmakTechnology/maven-web-application'
5 | }
6 | stage('2Test+build'){
7 | sh "${mavenHome}/bin/mvn clean package"
8 | }
9 | /*
10 | stage('SonarQube'){
11 | sh "${mavenHome}/bin/mvn sonar:sonar"
12 | }
13 | stage('4UploadArtifacts'){
14 | sh "${mavenHome}/bin/mvn deploy"
15 | }
16 |
17 | stage('5Deploy'){
18 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://54.166.85.32:8177/')], contextPath: null, war: 'target/*war'
19 | }
20 | stage('6Notification'){
21 | emailext body: '''Hi Team,
22 | Build status
23 | Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers'
24 | }
25 | */
26 | }
27 |
--------------------------------------------------------------------------------
/Jenkinsfile-Sep23-scripted:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven3.9.4'
3 | stage('1.CloneCode'){
4 | //Jenkins running on a Linux system
5 | //sh "git clone https://github.com/LandmakTechnology/maven-web-application"
6 | git "https://github.com/LandmakTechnology/maven-web-application"
7 | //Jenkins running on a windows system
8 | //bat "git clone https://github.com/LandmakTechnology/maven-web-application"
9 | }
10 | stage('2.mvnBuild'){
11 | sh "${mavenHome}/bin/mvn clean package"
12 | }
13 | stage('3.CodeQuality'){
14 | //sh "${mavenHome}/bin/mvn sonar:sonar"
15 | //edit pom.xml propertiesTAG with SonarQube server details
16 | }
17 | stage('4.UploadArtifacts'){
18 | //sh "${mavenHome}/bin/mvn deploy"
19 | //edit pom.xml distributionManagement TAG with repository details
20 | //edit settings.xml with nexus-user login credentials
21 | }
22 | stage('5.Deploy2UAT'){
23 | //use deploy-to-container plugin via pipeline syntax
24 | //deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war'
25 | //Deploying [/var/lib/jenkins/workspace/tesla-app-pipeline/target/tesla.war]
26 | }
27 | stage('6.6ManualApproval'){
28 | sh "echo 'Please review the application performance' "
29 | //timeout(time:600, unit:'MINUTES') {
30 | //input message: 'Application ready for deployment, Please review and approve'
31 | }
32 | }
33 | stage('7.Deploy2Prod'){
34 | sh "echo 'Deploy application to the customers/production' "
35 | //deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war'
36 |
37 | }
38 | stage('8.APM'){
39 | sh "echo 'monitoring and observation and alerting' "
40 | sh "echo 'application performance Monitoring in progress' "
41 | }
42 | stage('9.emailNotification'){
43 | sh "echo 'notify the team for unusual accurances' "
44 | sh "echo 'notify the team if the applications are down' "
45 | sh "echo 'notify the team if the latency is higher that expected' "
46 | emailext body: '''Hi Team,
47 |
48 | The build and Deployment status for tesla-app follows.
49 |
50 | Regards,
51 | Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: 'mylandmarktech@gmail.com'
52 |
53 | }
54 | }
55 |
56 |
--------------------------------------------------------------------------------
/Jenkinsfile-build23:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven3.9.4'
3 | stage('1.CloneCode'){
4 | //Jenkins running on a Linux system
5 | //sh "git clone https://github.com/LandmakTechnology/maven-web-application"
6 | git "https://github.com/LandmakTechnology/maven-web-application"
7 | //Jenkins running on a windows system
8 | //bat "git clone https://github.com/LandmakTechnology/maven-web-application"
9 | }
10 | stage('2.mvnBuild'){
11 | sh "${mavenHome}/bin/mvn clean package"
12 | }
13 | /*
14 | stage('3.CodeQuality'){
15 | //sh "${mavenHome}/bin/mvn sonar:sonar"
16 | //edit pom.xml propertiesTAG with SonarQube server details
17 | }
18 | stage('4.UploadArtifacts'){
19 | sh "${mavenHome}/bin/mvn deploy"
20 | //edit pom.xml distributionManagement TAG with repository details
21 | //edit settings.xml with nexus-user login credentials
22 | }
23 | stage('5.Deploy2UAT'){
24 | //use deploy-to-container plugin via pipeline syntax
25 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war'
26 | //Deploying [/var/lib/jenkins/workspace/tesla-app-pipeline/target/tesla.war]
27 | }
28 | stage('6.6ManualApproval'){
29 | sh "echo 'Please review the application performance' "
30 | timeout(time:600, unit:'MINUTES') {
31 | input message: 'Application ready for deployment, Please review and approve'
32 | }
33 | }
34 | stage('7.Deploy2Prod'){
35 | sh "echo 'Deploy application to the customers/production' "
36 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war'
37 |
38 | }
39 | stage('8.APM'){
40 | sh "echo 'monitoring and observation and alerting' "
41 | sh "echo 'application performance Monitoring in progress' "
42 | }
43 | */
44 | stage('9.emailNotification'){
45 | sh "echo 'notify the team for unusual accurances' "
46 | sh "echo 'notify the team if the applications are down' "
47 | sh "echo 'notify the team if the latency is higher that expected' "
48 | emailext body: '''Hi Team,
49 |
50 | The build and Deployment status for tesla-app follows.
51 |
52 | Regards,
53 | Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: 'mylandmarktech@gmail.com'
54 |
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Jenkinsfile-declarative23:
--------------------------------------------------------------------------------
1 | pipeline{
2 | agent any
3 | tools {
4 | maven "maven3.8.2"
5 | }
6 | //options {}
7 | //triggers {}
8 | stages{
9 | stage('1clone'){
10 | steps{
11 | sh "echo ready to automate build"
12 | git 'https://github.com/LandmakTechnology/maven-web-application'
13 | sh "echo latest application version collected from SCM"
14 | }
15 | }
16 | stage('2build'){
17 | steps{
18 | sh "echo build process starts "
19 | sh "mvn clean package"
20 | sh "echo build process ends"
21 | }
22 | }
23 |
24 | stage('3review'){
25 | steps{
26 | sh "echo CodeQuality review starts "
27 | sh "mvn sonar:sonar"
28 | sh "echo CodeQuality review ends"
29 | }
30 | }
31 | stage('4UploadArtifacts'){
32 | steps{
33 | sh "mvn deploy"
34 | sh "echo build and release job completed successfully"
35 | }
36 | }
37 | stage('5deployment'){
38 | steps{
39 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://54.166.85.32:8177/')], contextPath: null, war: 'target/*war'
40 | sh "echo deployment to production completed successfully"
41 | }
42 | }
43 | }
44 | post{
45 | failure{
46 | emailext body: '''Hi Team,
47 | Build failed
48 | Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers'
49 |
50 | }
51 | success{
52 | emailext body: '''Hi Team,
53 | Build succeeded
54 | Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers'
55 |
56 | }
57 | always{
58 | emailext body: '''Hi Team,
59 | Build status
60 | Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers'
61 |
62 | }
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/Jenkinsfile-ebay:
--------------------------------------------------------------------------------
1 | node {
2 | def mavenHome = tool name: 'maven3.8.2'
3 | stage('1-Clone') {
4 | git credentialsId: 'GitHUB-CREDENTIALS', url: 'https://github.com/Landmark-Technologies/maven-web-application'
5 | }
6 | stage('2-mavenBuild') {
7 | sh "${mavenHome}/bin/mvn clean package"
8 | }
9 | /*
10 | stage('3-CodeQuality') {
11 | sh "${mavenHome}/bin/mvn sonar:sonar"
12 | }
13 | stage('4-UploadArticats') {
14 | sh "${mavenHome}/bin/mvn deploy"
15 | }
16 |
17 | stage('5-Deploy-UAT') {
18 | deploy adapters: [tomcat9(credentialsId: 'deploy', path: '', url: 'http://54.204.83.221:8000/')], contextPath: null, war: 'target/*.war'
19 | }
20 | stage('6-EmailN') {
21 | emailext body: '''Hello Everyone,
22 |
23 | Build from Ebay pipeline project.
24 |
25 | Landmark Tecxhnologies''', subject: 'Build status', to: 'developers'
26 | }
27 | stage('Approval'){
28 | timeout(time:8, unit: 'HOURS' ) {
29 | input message: 'Please verify and approve'
30 | }
31 |
32 | }
33 | stage('prod-Deploy'){
34 | deploy adapters: [tomcat9(credentialsId: 'deploy', path: '', url: 'http://54.204.83.221:8000/')], contextPath: null, war: 'target/*.war'
35 | }
36 | */
37 |
38 | /*
39 | */
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/Jenkinsfile-sep23-decl:
--------------------------------------------------------------------------------
1 | pipeline{
2 | agent any
3 | tools{
4 | maven 'maven3.9.4'
5 | }
6 | //options{}
7 | //triggers{}
8 | stages{
9 | stage('1.CloneCode'){
10 | steps{
11 | sh "echo 'cloning the latest application version' "
12 | git "https://github.com/LandmakTechnology/maven-web-application"
13 | }
14 | }
15 | stage('2.mvnBuild'){
16 | steps{
17 | sh "echo 'running JUnit-test-cases' "
18 | sh "echo 'testing must passed to create artifacts ' "
19 | sh "mvn clean package"
20 | }
21 | }
22 | stage('3.CodeQuality'){
23 | steps{
24 | sh "echo 'Perfoming CodeQualityAnalysis' "
25 | //sh "mvn sonar:sonar"
26 | }
27 | }
28 | stage('4.UploadArtifacts'){
29 | steps{
30 | sh "mvn deploy"
31 | }
32 | }
33 | stage('5.Deploy2UAT'){
34 | steps{
35 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war'
36 | }
37 | }
38 | stage('6.ManualApproval'){
39 | steps{
40 | sh "echo 'Please review the application performance' "
41 | timeout(time:600, unit:'MINUTES') {
42 | input message: 'Application ready for deployment, Please review and approve'
43 | }
44 | }
45 | }
46 | stage('7.Deploy2Prod'){
47 | steps{
48 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war'
49 | }
50 | }
51 | }
52 | post{
53 | always{
54 | emailext body: '''Hi Team,
55 |
56 | The build and Deployment status for is a success.
57 |
58 | Regards,
59 | Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: 'mylandmarktech@gmail.com'
60 |
61 | }
62 | success{
63 | emailext body: '''Hi Team,
64 |
65 | The build and Deployment is a success.
66 |
67 | Regards,
68 | Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: 'mylandmarktech@gmail.com'
69 |
70 | }
71 | failure{
72 | emailext body: '''Hi Team,
73 |
74 | The build and Deployment failed.
75 |
76 | Regards,
77 | Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: 'mylandmarktech@gmail.com'
78 |
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/Jenkinsfile11:
--------------------------------------------------------------------------------
1 | node
2 | {
3 |
4 | def mavenHome = tool name: "maven3.6.2"
5 |
6 | echo "GitHub BranhName ${env.BRANCH_NAME}"
7 | echo "Jenkins Job Number ${env.BUILD_NUMBER}"
8 | echo "Jenkins Node Name ${env.NODE_NAME}"
9 |
10 | echo "Jenkins Home ${env.JENKINS_HOME}"
11 | echo "Jenkins URL ${env.JENKINS_URL}"
12 | echo "JOB Name ${env.JOB_NAME}"
13 |
14 | properties([[$class: 'JiraProjectProperty'], buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '2', daysToKeepStr: '', numToKeepStr: '2')), pipelineTriggers([pollSCM('* * * * *')])])
15 |
16 | stage("CheckOutCodeGit")
17 | {
18 | git branch: 'development', credentialsId: '65fb834f-a83b-4fe7-8e11-686245c47a65', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
19 | }
20 |
21 | stage("Build")
22 | {
23 | sh "${mavenHome}/bin/mvn clean package"
24 | }
25 |
26 | /*
27 | stage("ExecuteSonarQubeReport")
28 | {
29 | sh "${mavenHome}/bin/mvn sonar:sonar"
30 | }
31 |
32 | stage("UploadArtifactsintoNexus")
33 | {
34 | sh "${mavenHome}/bin/mvn deploy"
35 | }
36 |
37 | stage("DeployAppTomcat")
38 | {
39 | sshagent(['423b5b58-c0a3-42aa-af6e-f0affe1bad0c']) {
40 | sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war ec2-user@15.206.91.239:/opt/apache-tomcat-9.0.34/webapps/"
41 | }
42 | }
43 |
44 | stage('EmailNotification')
45 | {
46 | mail bcc: 'mylandmarktech@gmail.com', body: '''Build is over
47 |
48 | Thanks,
49 | Landmark Technologies,
50 | +14372152483.''', cc: 'mylandmarktech@gmail.com', from: '', replyTo: '', subject: 'Build is over!!', to: 'mylandmarktech@gmail.com'
51 | }
52 | */
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/Jenkinsfile24:
--------------------------------------------------------------------------------
1 | pipeline{
2 | agent any
3 | tools{
4 | maven 'maven3.9.9'
5 | }
6 | stages{
7 | stage('1.GitClone'){
8 | steps{
9 | sh "echo cloning the latest app version"
10 | git 'https://github.com/LandmakTechnology/maven-web-application'
11 | }
12 | }
13 | stage('2.mavenbuild'){
14 | steps{
15 | sh "echo creating deployanle packages"
16 | sh 'mvn clean package'
17 | }
18 | }
19 | /*
20 | stage('3.CodeQuality'){
21 | steps{
22 | sh "mvn sonar:sonar"
23 | sh "echo CodeQualityAnalysis completed"
24 | }
25 | }
26 | stage('4.UploadArtifacts'){
27 | steps{
28 | sh "mvn deploy"
29 | sh "echo artifacts uploaded successfully"
30 | sh "echo I am now a Build and Release Engineer"
31 | sh "echo Build and release completed"
32 | }
33 | }
34 | stage('5.Deploy2UAT'){
35 | steps{
36 | sh "echo Deployment is ready for the client review"
37 | sh "echo using deploy to container plugin"
38 | }
39 | }
40 | stage('6approval'){
41 | steps{
42 | sh "echo Deployment is ready for the client review"
43 | sh "echo using deploy to container plugin"
44 | echo "ready for inspection"
45 | timeout(time:5, unit:'DAYS'){
46 | input message: 'Application ready for deployment, Please review and approve'
47 | }
48 | }
49 | }
50 | */
51 | stage('7.Deploy2Prod'){
52 | steps{
53 | sh "echo application reviewed, approved and ready for the market"
54 | emailext body: 'Hello Review and approve. ', subject: 'success', to: 'mylandmarktech@gmail.com'
55 | }
56 | }
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/Jenkinsfile34:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven3.9.6'
3 | stage('1.clonecode'){
4 | git "https://github.com/LandmakTechnology/maven-web-application"
5 | }
6 | stage('2.mavenBuild'){
7 | sh "${mavenHome}/bin/mvn package"
8 | }
9 | /*
10 | stage('3.codeQualityAnalysis'){
11 | sh "${mavenHome}/bin/mvn sonar:sonar"
12 | }
13 |
14 | stage('4.uploadArtifacts'){
15 | sh "${mavenHome}/bin/mvn deploy"
16 | }
17 | stage('5.deploy2UAT'){
18 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://3.144.85.2:8088/')], contextPath: null, war: 'target/*war'
19 |
20 | }
21 | stage('6.ManualApproval'){
22 | sh " echo 'Please review & approve' "
23 | timeout(time:300, unit:'MINUTES')
24 | {
25 | input message: 'Application ready for deployment, Please review and approve'
26 | }
27 | }
28 | stage('7.deploy2prod'){
29 | //use deploy to container plugin
30 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://3.144.85.2:8088/')], contextPath: null, war: 'target/*war'
31 |
32 | }
33 | stage('8.apm'){
34 | sh "echo 'monitoring and observation and alerting' "
35 | sh "echo 'application performance Monitoring in progress' "
36 | }
37 | stage('9.notification'){
38 | sh "echo create email notification to resolve any issue that may arise"
39 | //use pipeline syntax and email notification plugin to achieve this
40 | emailext body: '''The build and Deployment status for tesla-webapp.
41 |
42 | Regards,
43 | Landmark Technologies''', recipientProviders: [developers(), upstreamDevelopers(), buildUser()], subject: 'job status', to: 'mylandmarktech@gmail.com'
44 |
45 | }
46 | */
47 | }
48 |
--------------------------------------------------------------------------------
/Jenkinsfile39scripted:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven399'
3 | stage('1clone'){
4 | git "https://github.com/LandmakTechnology/maven-web-application"
5 | }
6 | stage('2Test+build'){
7 | sh "${mavenHome}/bin/mvn clean package" //linux OS
8 | //bat "mvn clean package" //windows OS
9 | }
10 | /*
11 | stage('3codeQualityAnalysis'){
12 | sh "${mavenHome}/bin/mvn sonar:sonar"
13 | }
14 | stage('4uploads2Nexus'){
15 | //sh "${mavenHome}/bin/mvn deploy"
16 | }
17 | stage('5deploy2UAT'){
18 | //deploy to container
19 | deploy adapters: [tomcat9(credentialsId: 'tomcatAccess', path: '', url: 'http://54.234.37.143:9077/')], contextPath: null, war: 'target/*war'
20 | }
21 | stage('6ManualApproval'){
22 | sh "echo 'please review and approve' "
23 | timeout(time:5, unit:'HOURS')
24 | {
25 | input message: 'Application ready for deployment, Please review and approve'
26 | }
27 | }
28 | stage('7deploy2prod'){
29 | //deploy to container
30 | deploy adapters: [tomcat9(credentialsId: 'tomcatAccess', path: '', url: 'http://54.234.37.143:9077/')], contextPath: null, war: 'target/*war'
31 | }
32 | stage('8notification'){
33 | emailext body: '''Hi Team,
34 |
35 | Application deployed.
36 |
37 | Regards
38 | Landmark Technologies ''', recipientProviders: [contributor(), developers()], subject: 'deployment status', to: 'mylandmarktech@gmail.com'
39 | }
40 | */
41 | }
42 |
--------------------------------------------------------------------------------
/JenkinsfileDeclarative:
--------------------------------------------------------------------------------
1 | pipeline{
2 |
3 | agent any
4 |
5 | tools
6 | {
7 | maven 'maven3.6.3'
8 |
9 | }
10 |
11 | triggers{
12 | pollSCM('* * * * *')
13 | }
14 |
15 | options{
16 | timestamps()
17 | buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '2', daysToKeepStr: '', numToKeepStr: '2'))
18 | }
19 |
20 | stages{
21 |
22 | stage('CheckoutCode')
23 | {
24 | steps{
25 | git branch: 'development', credentialsId: '8e348aa2-9531-4dbe-863d-1adb64897470', url: 'https://github.com/LandmakTechnology/maven-web-application.git'
26 | }
27 | }
28 |
29 | stage('Build')
30 | {
31 | steps{
32 | sh "mvn clean package"
33 | }
34 | }
35 |
36 | stage('ExecuteSonarQubeReport')
37 | {
38 | steps{
39 | sh "mvn sonar:sonar"
40 | }
41 | }
42 |
43 | stage('UploadArtifactintoNexus')
44 | {
45 | steps{
46 | sh "mvn deploy"
47 | }
48 | }
49 |
50 | stage('DeployAppIntoTomcat')
51 | {
52 | steps{
53 | sshagent(['2b7b0c6a-5eff-4f4a-82c3-3630f91c70b5']) {
54 | sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war ec2-user@3.1.222.74:/opt/apache-tomcat-9.0.41/webapps/"
55 | }
56 | }
57 | }
58 |
59 |
60 |
61 | }
62 |
63 | post{
64 |
65 |
66 | success{
67 | mail bcc: 'mylandmarktech@gmail.com', body: '''BuildOver!....
68 |
69 | Regards,
70 | Landmark Technologies,
71 | 9980923226''', cc: 'mylandmarktech@gmail.com', from: '', replyTo: '', subject: 'BuildOver!!', to: 'mylandmarktech@gmail.com'
72 | }
73 |
74 | failure{
75 | mail bcc: 'devopstrainingblr@gmail.com', body: '''BuildOver!....
76 |
77 | Regards,
78 | Landmark Technologies,
79 | +1 437 215 2483,''', cc: 'mylandmarktech@gmail.com', from: '', replyTo: '', subject: 'BuildOver!!', to: 'mylandmarktech@gmail.com'
80 | }
81 |
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/JenkinsfileJuly2021:
--------------------------------------------------------------------------------
1 | node('wallmart-node'){
2 |
3 | def mavenHome = tool name: "maven3.8.2"
4 |
5 | echo "GitHub BranhName ${env.BRANCH_NAME}"
6 | echo "Jenkins Job Number ${env.BUILD_NUMBER}"
7 | echo "Jenkins Node Name ${env.NODE_NAME}"
8 |
9 | echo "Jenkins Home ${env.JENKINS_HOME}"
10 | echo "Jenkins URL ${env.JENKINS_URL}"
11 | echo "JOB Name ${env.JOB_NAME}"
12 |
13 | stage('CheckOutCode')
14 | {
15 | git branch: 'development', credentialsId: '12993250-1ff3-40a0-9978-794e74dcf712', url: 'https://github.com/LandmakTechnology/maven-web-application.git'
16 | }
17 |
18 | stage('Build')
19 | {
20 | sh "${mavenHome}/bin/mvn clean package"
21 | }
22 |
23 | /*
24 | stage('SonarQubeReport'){
25 | sh "${mavenHome}/bin/mvn clean sonar:sonar"
26 | }
27 |
28 |
29 | stage('UploadArtifactIntoNexus'){
30 | sh "${mavenHome}/bin/mvn clean deploy"
31 | }
32 |
33 | stage('DeployAppIntoTomcatServer')
34 | {
35 | sshagent(['c7a7b3d8-55f0-4f83-9e81-d56c154cc647']) {
36 | sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war ec2-user@15.206.90.6:/opt/apache-tomcat-9.0.52/webapps/"
37 | }
38 | }
39 |
40 | */
41 |
42 | stage('SendEmailNotification'){
43 | emailext body: '''Build is over !!
44 |
45 | Regards,
46 | Landmark Technologies,
47 | 9980923226''', subject: 'Build Over... !!', to: 'mylandmarktech@gmail.com'
48 | }
49 |
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/Jenkinsfile_Dec2023:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven3.9.6'
3 | stage('1.clonecode'){
4 | git "https://github.com/LandmakTechnology/maven-web-application"
5 | }
6 | stage('2.mavenBuild'){
7 | sh "${mavenHome}/bin/mvn package"
8 | }
9 | /*
10 | stage('3.codeQualityAnalysis'){
11 | sh "${mavenHome}/bin/mvn sonar:sonar"
12 | }
13 |
14 | stage('4.uploadArtifacts'){
15 | sh "${mavenHome}/bin/mvn deploy"
16 | }
17 | stage('5.deploy2UAT'){
18 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://3.144.85.2:8088/')], contextPath: null, war: 'target/*war'
19 |
20 | }
21 | stage('6.ManualApproval'){
22 | sh " echo 'Please review & approve' "
23 | timeout(time:300, unit:'MINUTES')
24 | {
25 | input message: 'Application ready for deployment, Please review and approve'
26 | }
27 | }
28 | stage('7.deploy2prod'){
29 | //use deploy to container plugin
30 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://3.144.85.2:8088/')], contextPath: null, war: 'target/*war'
31 |
32 | }
33 | */
34 | stage('8.apm'){
35 | sh "echo 'monitoring and observation and alerting' "
36 | sh "echo 'application performance Monitoring in progress' "
37 | }
38 | stage('9.notification'){
39 | sh "echo create email notification to resolve any issue that may arise"
40 | //use pipeline syntax and email notification plugin to achieve this
41 | emailext body: '''The build and Deployment status for tesla-webapp.
42 |
43 | Regards,
44 | Landmark Technologies''', recipientProviders: [developers(), upstreamDevelopers(), buildUser()], subject: 'job status', to: 'mylandmarktech@gmail.com'
45 |
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/Jenkinsfile_June2024:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven3.9.7'
3 | stage('1.GitClone'){
4 | git "https://github.com/LandmakTechnology/maven-web-application"
5 | }
6 | stage('2.mavenBuild'){
7 | sh "${mavenHome}/bin/mvn package"
8 | }
9 | stage('3.sonaqubeQuality'){
10 | sh "${mavenHome}/bin/mvn sonar:sonar"
11 | }
12 | stage('4.UploadArtifacts'){
13 | //sh "${mavenHome}/bin/mvn deploy"
14 | sh "echo The build and release job is ended"
15 | }
16 | stage('5.deploy2UAT'){
17 | sh "echo deployment launched using deploy2container plugin"
18 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://54.152.168.210:8088/')], contextPath: null, war: 'target/*war'
19 |
20 | }
21 | stage('6.ManualApproval'){
22 | sh " echo 'Please review & approve' "
23 | timeout(time:3, unit:'HOURS')
24 | {
25 | input message: 'Application ready for deployment, Please review and approve'
26 | }
27 | }
28 | stage('7.deploy2prod'){
29 | sh "echo deployment launched to production"
30 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://54.152.168.210:8088/')], contextPath: null, war: 'target/*war'
31 |
32 | }
33 | stage('8.apm'){
34 | sh "echo 'monitoring, observation and alerting' "
35 | sh "echo 'application performance Monitoring in progress' "
36 | }
37 | stage('9.notification'){
38 | emailext body: '''The build and Deployment status for tesla-webapp.
39 |
40 | Regards,
41 | Landmark Technologies''', recipientProviders: [developers(), upstreamDevelopers(), buildUser()], subject: 'job status', to: 'mylandmarktech@gmail.com'
42 |
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/Jenkinsfile_March2023:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven3.9.1'
3 | stage('1.CodeClone'){
4 | git credentialsId: 'gitHubCredentials', url: 'https://github.com/LandmakTechnology/maven-web-application'
5 | }
6 | stage('2MavenBuild'){
7 | sh "${mavenHome}/bin/mvn package"
8 | }
9 | /*
10 | stage('3codeQuality'){
11 | sh "${mavenHome}/bin/mvn sonar:sonar"
12 | }
13 | stage('4UploadArtifacts'){
14 | sh "${mavenHome}/bin/mvn deploy"
15 | }
16 | stage('5deploy2UAT'){
17 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://100.26.217.86:8080/')], contextPath: null, war: 'target/*war'
18 | }
19 | stage('6Manualapproval'){
20 | sh "echo 'ready for review' "
21 | timeout(time:5, unit:'HOURS') {
22 | input message: 'Application ready for deployment, Please review and approve'
23 | }
24 | }
25 | stage('7deploy2Prod'){
26 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://100.26.217.86:8080/')], contextPath: null, war: 'target/*war'
27 | }
28 | stage('8emailNotify'){
29 | emailext body: '''Hello Team,
30 |
31 | Build is done.
32 |
33 | LANDMARKTECH''', recipientProviders: [developers(), contributor(), upstreamDevelopers()], subject: 'Build Status', to: 'mylandmarktech@gmail.com'
34 | }
35 | */
36 | }
37 |
--------------------------------------------------------------------------------
/Jenkinsfile_dec_April2025:
--------------------------------------------------------------------------------
1 | pipeline{
2 | agent any
3 | tools {
4 | maven 'maven399'
5 | //node 'node2.15'
6 | }
7 | //options {}
8 | //triggers {}
9 | stages{
10 | stage('1CloneCode'){
11 | steps{
12 | sh "echo 'cloning the latest application version' "
13 | git "https://github.com/LandmakTechnology/maven-web-application"
14 | }
15 | }
16 | stage('2test+build'){
17 | steps{
18 | sh "echo 'running JUnit-test-cases' "
19 | sh "echo 'testing must passed to create artifacts ' "
20 | sh "mvn clean package"
21 | }
22 | }
23 | /*
24 | stage('3CodeQuality'){
25 | steps{
26 | sh "echo 'Perfoming CodeQualityAnalysis' "
27 | sh "echo 'CodeQuality must meet the benchmark before deployment' "
28 | sh "mvn sonar:sonar"
29 | }
30 | }
31 | stage('4UploadArtifacts'){
32 | steps{
33 | sh "echo Uploading Artifacts"
34 | //sh "mvn deploy"
35 | }
36 | }
37 | stage('5Deploy2UAT'){
38 | steps{
39 | sh "echo deploying to UAT"
40 | deploy adapters: [tomcat9(credentialsId: 'tomcatAccess', path: '', url: 'http://54.234.37.143:9077/')], contextPath: null, war: 'target/*war'
41 | }
42 | }
43 | stage('6ManualApproval'){
44 | steps{
45 | sh "echo 'Please review the application and accept' "
46 | timeout(time:600, unit:'MINUTES'){
47 | input message: 'Application ready for deployment, Please review and approve'
48 | }
49 | }
50 | }
51 |
52 | stage('7Deploy2Prod'){
53 | steps{
54 | sh "echo deploying apps to production/market"
55 | deploy adapters: [tomcat9(credentialsId: 'tomcatAccess', path: '', url: 'http://54.234.37.143:9077/')], contextPath: null, war: 'target/*war'
56 | }
57 |
58 | }
59 | */
60 | }
61 |
62 | post{
63 | always{
64 | emailext body: '''Hi Team,
65 |
66 | The test, build, and deployment to production was a success.
67 |
68 | Regards,
69 | Landmark TRechnologies''', recipientProviders: [developers(), upstreamDevelopers()], subject: 'success', to: 'mylandmarktech@gmail.com'
70 | }
71 | success{
72 | emailext body: '''Hi Team,
73 |
74 | The test, build, and deployment to production was a success.
75 |
76 | Regards,
77 | Landmark TRechnologies''', recipientProviders: [developers(), upstreamDevelopers()], subject: 'success', to: 'mylandmarktech@gmail.com'
78 | }
79 | failure{
80 | emailext body: '''Hi Team,
81 |
82 | The test, build, and deployment to production was a success.
83 |
84 | Regards,
85 | Landmark TRechnologies''', recipientProviders: [developers(), upstreamDevelopers()], subject: 'success', to: 'mylandmarktech@gmail.com'
86 | }
87 | }
88 | }
89 |
90 |
--------------------------------------------------------------------------------
/Jenkinsfile_declarative042023:
--------------------------------------------------------------------------------
1 | pipeline{
2 | agent {
3 | label 'master'
4 | }
5 | tools {
6 | maven 'maven3.9.1'
7 | }
8 | //options{}
9 | //triggers{}
10 | stages {
11 | stage('1Clone'){
12 | steps{
13 | sh "echo 'cloning the latest application version' "
14 | git "https://github.com/LandmakTechnology/maven-web-application"
15 | sh "echo 'latest application version available for testing and build' "
16 | }
17 | }
18 | stage('2TestBuild'){
19 | steps{
20 | sh "echo 'running JUnit-test-cases' "
21 | sh "echo 'testing must passed to create artifacts ' "
22 | sh "mvn clean package"
23 | }
24 | }
25 | stage('3CodeQualityAnalysis') {
26 | steps{
27 | sh "echo setup sonarQube authentication"
28 | sh "echo 'Perfoming CodeQualityAnalysis' "
29 | sh "mvn sonar:sonar"
30 | }
31 | }
32 | stage('4UploadArtifacts') {
33 | steps{
34 | sh "echo configure nexus authentication"
35 | //sh "mvn deploy"
36 | sh "echo artifacts uploaded"
37 | }
38 | }
39 | stage('5deploy') {
40 | steps{
41 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://100.26.217.86:8080/')], contextPath: null, war: 'target/*war'
42 | }
43 | }
44 |
45 | //stage('5deploy') {}
46 | }
47 | post{
48 | always{
49 | emailext body: '''Great job team.
50 |
51 | LandmarkTech ''', recipientProviders: [buildUser(), developers()], subject: 'Build Success', to: 'mylandmarktech@gmail.com'
52 |
53 | }
54 | success{
55 | emailext body: '''Great job team.
56 |
57 | LandmarkTech ''', recipientProviders: [buildUser(), developers()], subject: 'Build Success', to: 'mylandmarktech@gmail.com'
58 |
59 | }
60 | failure{
61 | emailext body: '''Please review this job.
62 |
63 | LandmarkTech ''', recipientProviders: [buildUser(), developers()], subject: 'Build failed', to: 'mylandmarktech@gmail.com'
64 |
65 | }
66 |
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/Jenkinsfile_declarativeDec2023:
--------------------------------------------------------------------------------
1 | pipeline{
2 | agent any
3 | //options{}
4 | //triggers{}
5 | tools {
6 | maven 'maven3.9.6'
7 | }
8 | stages{
9 | stage('1clonecode'){
10 | steps{
11 | git "https://github.com/LandmakTechnology/maven-web-application"
12 | }
13 | }
14 | stage('2mavenBuild'){
15 | steps{
16 | sh "echo 'running JUnit-test-cases' "
17 | sh "echo 'testing must passed to create artifacts ' "
18 | sh "mvn clean package"
19 | }
20 | }
21 | stage('3CodeQuality'){
22 | steps{
23 | // sh "mvn sonar:sonar"
24 | sh "echo CodeQualityAnalysis completed"
25 | }
26 | }
27 | stage('4UploadArtifacts'){
28 | steps{
29 | //sh "mvn deploy"
30 | sh "echo artifacts uploaded successfully"
31 | sh "echo I am now a Build and Release Engineer"
32 | sh "echo Build and release completed"
33 | }
34 | }
35 | stage('5deploy2UAT'){
36 | steps{
37 | sh "echo Deployment is ready for the client review"
38 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://10.0.0.38:8088/')], contextPath: null, war: 'target/*war '
39 |
40 | }
41 | }
42 | stage('6manualApproval'){
43 | steps{
44 | sh "echo Review the application and confirm its performance within 5 hours"
45 | timeout(time:5, unit:'HOURS') {
46 | input message: 'Application ready for deployment, Please review and approve'
47 | }
48 | }
49 | }
50 | stage('7deploy2prod'){
51 | steps{
52 | sh "echo application reviewed, approved and ready for the market"
53 | deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://10.0.0.38:8088/')], contextPath: null, war: 'target/*war '
54 |
55 | }
56 | }
57 | }
58 | post{
59 | always{
60 | emailext body: '''Hi,
61 |
62 | Build status.
63 |
64 | Landmark Technologies.
65 | Tel: +1 437 215 2483''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: 'mylandmarktech@gmail.com'
66 |
67 | }
68 | success {
69 | emailext body: '''Hi,
70 |
71 | Build successful.
72 |
73 | Landmark Technologies.
74 | Tel: +1 437 215 2483''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: 'mylandmarktech@gmail.com'
75 |
76 | }
77 | failure{
78 | emailext body: '''Hi,
79 |
80 | Build failed.
81 |
82 | Landmark Technologies.
83 | Tel: +1 437 215 2483''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: 'mylandmarktech@gmail.com'
84 |
85 | }
86 | }
87 | }
88 |
89 |
--------------------------------------------------------------------------------
/Jenkinsfile_docker:
--------------------------------------------------------------------------------
1 | pipeline{
2 | agent any
3 | tools{
4 | maven "maven3.8.4"
5 | }
6 | stages{
7 | stage('GitClone'){
8 | steps{
9 | echo "cloning the lastest applications version"
10 | git "https://github.com/LandmakTechnology/maven-web-application"
11 | }
12 | }
13 | stage('Test+Build'){
14 | steps{
15 | sh "echo Running unitTesting"
16 | sh "mvn clean package"
17 | echo "echo test successful and backupArtifacts created"
18 | }
19 | }
20 | stage('codeQuality'){
21 | steps{
22 | sh "echo Running detail code analysis"
23 | sh "mvn sonar:sonar"
24 | sh "echo All conditions met/passed"
25 | }
26 | }
27 | stage('upLoadArtifacts'){
28 | steps{
29 | sh "echo Running detail code analysis"
30 | sh "mvn deploy"
31 | sh "echo backupArtifacts in nexus"
32 | }
33 | }
34 | stage('predeployment'){
35 | steps{
36 | sh "echo creating docker image"
37 | sh "docker build -t mylandmarktech/maven-web-app . "
38 | sh "docker push mylandmarktech/maven-web-app"
39 | }
40 | }
41 | stage('UnDeploy'){
42 | steps{
43 | sh "echo UNDEPLOYING existing application"
44 | sh "docker rm -f webapp"
45 | }
46 | }
47 | stage('deployment'){
48 | steps{
49 | sh "echo application ready for deployment"
50 | sh "docker run -d -p 8000:8080 --name webapp mylandmarktech/maven-web-app"
51 | }
52 | }
53 | stage('emailNotification'){
54 | steps{
55 | sh "echo deployment successful"
56 | }
57 | }
58 |
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Jenkinsfile_paypal28:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven3.8.6'
3 | stage('1cloneCode'){
4 | sh "echo running a software build and deployment project for payPal"
5 | git "https://github.com/LandmakTechnology/maven-web-application"
6 | }
7 | stage('2Test&Build'){
8 | sh "${mavenHome}/bin/mvn install"
9 | }
10 | /*
11 | stage('3CodeQuality'){
12 | sh "${mavenHome}/bin/mvn sonar:sonar"
13 | }
14 | stage('4UploadArtifacts'){
15 | sh "${mavenHome}/bin/mvn deploy"
16 | }
17 | stage('5deploy_uat'){
18 | //sh "scp "
19 | deploy adapters: [tomcat9(credentialsId: 'tomcatCredentials', path: '', url: 'http://18.119.10.206:8080/')], contextPath: null, war: 'target/*war'
20 | }
21 | stage('6Approval'){
22 | timeout(time:9, unit:'HOURS') {
23 | input message: 'Application ready for deployment, Please review and approve'
24 | }
25 | }
26 | stage('7deploy_prod'){
27 | deploy adapters: [tomcat9(credentialsId: 'tomcatCredentials', path: '', url: 'http://18.119.10.206:8080/')], contextPath: null, war: 'target/*war'
28 | }
29 | stage('8Notification'){
30 | // Pipeline Syntax
31 | emailext body: '''Build status for frontend application.
32 |
33 | Regards,
34 | Landmark Technologies''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build Status', to: 'paypal-team@gmail.com'
35 | }
36 | */
37 | }
38 |
--------------------------------------------------------------------------------
/Jenkinsfile_sep22:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven3.8.6'
3 | stage('1cloneCode'){
4 | git "https://github.com/LandmakTechnology/maven-web-application"
5 | }
6 | stage('2Test&Build'){
7 | sh "${mavenHome}/bin/mvn clean package"
8 | //bat "${mavenHome}/bin/mvn clean package"
9 | }
10 | /*
11 | stage('3codeQuality'){
12 | sh "${mavenHome}/bin/mvn sonar:sonar"
13 | }
14 | stage('4uploadArtifacts'){
15 | //sh "${mavenHome}/bin/mvn deploy"
16 | //http://52.53.227.31:8191/landmark/repository/tesla-fe-snapshots/
17 | //http://52.53.227.31:8191/landmark/repository/tesla-fe-releases/
18 | // vi pom.xml and added repository details
19 | // vi setting.xml and add AUTHENTICATION details
20 | }
21 | stage('5deploy2UAT'){
22 | sh "echo 'deploy to UAT' "
23 | deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war'
24 | }
25 | stage('6approvalGate'){
26 | sh "echo 'ready for review' "
27 | timeout(time:5, unit:'DAYS') {
28 | input message: 'Application ready for deployment, Please review and approve'
29 | }
30 | }
31 | stage('7deploy2Prod'){
32 | sh "sleep 50"
33 | deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war'
34 | }
35 | stage('8emailNotification'){
36 | emailext body: '''Hi All,
37 |
38 | Check Build status.
39 |
40 | Landmark Technologies''', recipientProviders: [buildUser(), developers(), upstreamDevelopers(), brokenBuildSuspects(), brokenTestsSuspects(), contributor()], subject: 'build status', to: 'tesla-app@gmail.com'
41 | }
42 | */
43 | }
44 |
--------------------------------------------------------------------------------
/Jenkinsfile_tesla:
--------------------------------------------------------------------------------
1 | node{
2 | def mavenHome = tool name: 'maven3.8.6'
3 | stage('1cloneCode'){
4 | git "https://github.com/LandmakTechnology/maven-web-application"
5 | }
6 | stage('2Test&Build'){
7 | sh "${mavenHome}/bin/mvn clean package"
8 | //bat "${mavenHome}/bin/mvn clean package"
9 | }
10 | stage('3codeQuality'){
11 | sh "${mavenHome}/bin/mvn sonar:sonar"
12 | }
13 | stage('4uploadArtifacts'){
14 | //sh "${mavenHome}/bin/mvn deploy"
15 | //http://52.53.227.31:8191/landmark/repository/tesla-fe-snapshots/
16 | //http://52.53.227.31:8191/landmark/repository/tesla-fe-releases/
17 | // vi pom.xml and added repository details
18 | // vi setting.xml and add AUTHENTICATION details
19 | }
20 | stage('5deploy2UAT'){
21 | sh "echo 'deploy to UAT' "
22 | deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war'
23 | }
24 | stage('6approvalGate'){
25 | sh "echo 'ready for review' "
26 | timeout(time:5, unit:'DAYS') {
27 | input message: 'Application ready for deployment, Please review and approve'
28 | }
29 | }
30 | stage('7deploy2Prod'){
31 | sh "sleep 50"
32 | deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war'
33 | }
34 | stage('8emailNotification'){
35 | emailext body: '''Hi All,
36 |
37 | Check Build status.
38 |
39 | Landmark Technologies''', recipientProviders: [buildUser(), developers(), upstreamDevelopers(), brokenBuildSuspects(), brokenTestsSuspects(), contributor()], subject: 'build status', to: 'tesla-app@gmail.com'
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/JenkinsfiledeclarativeJuneBathc:
--------------------------------------------------------------------------------
1 | pipeline{
2 |
3 | agent{
4 | label 'slaves'
5 | }
6 |
7 | tools{
8 | maven 'maven3.6.3'
9 |
10 | }
11 |
12 | triggers{
13 | pollSCM('* * * * *')
14 | }
15 |
16 | options{
17 | timestamps()
18 | buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5'))
19 | }
20 |
21 | stages{
22 |
23 | stage('CheckOutCode'){
24 | steps{
25 | git branch: 'development', credentialsId: '957b543e-6f77-4cef-9aec-82e9b0230975', url: 'https://github.com/LandmakTechnology/maven-web-application-1.git'
26 |
27 | }
28 | }
29 |
30 | stage('Build'){
31 | steps{
32 | sh "mvn clean package"
33 | }
34 | }
35 | /*
36 | stage('ExecuteSonarQubeReport'){
37 | steps{
38 | sh "mvn clean sonar:sonar"
39 | }
40 | }
41 |
42 | stage('UploadArtifactsIntoNexus'){
43 | steps{
44 | sh "mvn clean deploy"
45 | }
46 | }
47 |
48 | stage('DeployAppIntoTomcat'){
49 | steps{
50 | sshagent(['bfe1b3c1-c29b-4a4d-b97a-c068b7748cd0']) {
51 | sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war ec2-user@35.154.190.162:/opt/apache-tomcat-9.0.50/webapps/"
52 | }
53 | }
54 | }
55 | */
56 | }//Stages Closing
57 |
58 | post{
59 |
60 | success{
61 | emailext to: 'mylandmarktech@gmail.com,mylandmarktech@yahoo.com',
62 | subject: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.",
63 | body: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.",
64 | replyTo: 'mylandmarktech@gmail.com'
65 | }
66 |
67 | failure{
68 | emailext to: 'mylandmarktech@gmail.com,mylandmarktech@yahoo.com',
69 | subject: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.",
70 | body: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.",
71 | replyTo: 'mylandmarktech@gmail.com'
72 | }
73 |
74 | }
75 |
76 |
77 | }//Pipeline closing
78 |
--------------------------------------------------------------------------------
/Jenkinsfiles-declarative29:
--------------------------------------------------------------------------------
1 | pipeline{
2 | agent any
3 | tools {
4 | maven "maven3.6.0"
5 | }
6 | stages {
7 | stage('1GetCode'){
8 | steps{
9 | sh "echo 'cloning the latest application version' "
10 | git branch: 'feature', credentialsId: 'gitHubCredentials', url: 'https://github.com/LandmakTechnology/maven-web-application'
11 | }
12 | }
13 | stage('3Test+Build'){
14 | steps{
15 | sh "echo 'running JUnit-test-cases' "
16 | sh "echo 'testing must passed to create artifacts ' "
17 | sh "mvn clean package"
18 | }
19 | }
20 | stage('4CodeQuality'){
21 | steps{
22 | sh "echo 'Perfoming CodeQualityAnalysis' "
23 | sh "mvn sonar:sonar"
24 | }
25 | }
26 | stage('5uploadNexus'){
27 | steps{
28 | sh "mvn deploy"
29 | }
30 | }
31 | stage('8deploy2prod'){
32 | steps{
33 | deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war'
34 | }
35 | }
36 | }
37 | post{
38 | always{
39 | emailext body: '''Hey guys
40 | Please check build status.
41 |
42 | Thanks
43 | Landmark
44 | +1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com'
45 | }
46 | success{
47 | emailext body: '''Hey guys
48 | Good job build and deployment is successful.
49 |
50 | Thanks
51 | Landmark
52 | +1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com'
53 | }
54 | failure{
55 | emailext body: '''Hey guys
56 | Build failed. Please resolve issues.
57 |
58 | Thanks
59 | Landmark
60 | +1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: 'paypal-team@gmail.com'
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/deploy-k8s.yml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: webapp
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: myapp
9 | template:
10 | metadata:
11 | labels:
12 | app: myapp
13 | spec:
14 | containers:
15 | - name: myapp
16 | image: mylandmarktech/maven-web-app
17 | ports:
18 | - containerPort: 8080
19 | ---
20 | apiVersion: v1
21 | kind: Service
22 | metadata:
23 | name: myapp
24 | spec:
25 | type: NodePort
26 | selector:
27 | app: myapp
28 | ports:
29 | - port: 80
30 | targetPort: 8080
31 | nodePort: 30300
32 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.1'
2 | services:
3 | springboot:
4 | image: mylandmarktech/maven-web-app:VERSION
5 | restart: always
6 | ports:
7 | - 9090:8080
8 | networks:
9 | - mavenappbridge
10 | networks:
11 | mavenappbridge:
12 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
Service : Get Employee Details
52 |Landmark Technologies - Consultant, Training and Software Development
55 |Copyrights 2021 by Landmark Technologies
56 | 57 | 58 |