Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New edit #20

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 32 additions & 52 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,54 +1,34 @@
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")
{
node{
def mavenHome = tool name: 'maven3.9.2'
stage('1.clone'){
//git "https://github.com/solomanty/maven-web-application"
git branch: 'development', url: 'https://github.com/solomanty/maven-web-application'
}
stage('2.test and build'){
sh "${mavenHome}/bin/mvn package"
}
stage('3.CodeQualityAnalysis'){
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 [email protected]:/opt/apache-tomcat-9.0.34/webapps/"
}
}

stage('EmailNotification')
{
mail bcc: '[email protected]', body: '''Build is over
}
stage('4.Artifactory'){
sh "${mavenHome}/bin/mvn deploy"}
stage('5.deploy2UAT'){
deploy adapters: [tomcat9(credentialsId: 'tomcat-credential', path: '', url: 'http://52.23.203.16:8177/')], contextPath: null, war: 'target/*war'
}
stage('6.approval'){
sh "echo 'apps ready for review' "
timeout(time:5, unit: 'HOURS') {
input message: 'Application ready for deployment, please review and approve'
}
}
stage('7.production'){
deploy adapters: [tomcat9(credentialsId: 'tomcat-credential', path: '', url: 'http://52.23.203.16:8177/')], contextPath: null, war: 'target/*war'
}
stage('8.notification'){
emailext body: '''Hello Team,
Please check the pipeline work done.

Thanks,
Mithun Technologies,
9980923226.''', cc: '[email protected]', from: '', replyTo: '', subject: 'Build is over!!', to: '[email protected]'
}
*/

}
Solomon Alamutu''', recipientProviders: [buildUser()], subject: 'Build status', to: 'developers'
}
}

15 changes: 8 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.mt</groupId>
<artifactId>maven-web-application</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.3-SNAPSHOT</version>

<name>maven-web-application</name>

Expand All @@ -21,7 +21,7 @@
<spring.version>5.1.2.RELEASE</spring.version>
<junit.version>4.11</junit.version>
<log4j.version>1.2.17</log4j.version>
<sonar.host.url>http:3.96.196.171:9000/</sonar.host.url>
<sonar.host.url>http:54.152.58.6:9000/</sonar.host.url>
<sonar.login>admin</sonar.login>
<sonar.password>admin</sonar.password>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -98,19 +98,20 @@
<repository>
<id>nexus</id>
<name>Landmark Technologies Releases Nexus Repository</name>
<url>http://35.174.19.3:8081/repository/amazon-release/</url>
<url>http://44.201.230.105:8081/repository/tesla-releases/</url>
</repository>



<snapshotRepository>
<id>nexus</id>
<name>Landmark Technologies Snapshot Nexus Repository </name>
<url>http://35.174.19.3:8081/repository/amazon-snapshot/</url>
<name>Landmark Technologies Snapshot Nexus Repository</name>
<url>http://44.201.230.105:8081/repository/tesla-snapshots/</url>
</snapshotRepository>

</distributionManagement>

<build>
<finalName>Landmark</finalName>
<finalName>Tesla-webapp</finalName>

<plugins>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/jsps/home.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</head>
<body>
<h1 align="center">Landmark Technology --> A Metropolitan University Company</h1>
<h1 align="center"> 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.
<h1 align="center"> Welcome to Landmark Technology.......We have a demo on DevOps E Degree with Linux and AWS on Saturday July 15, 2023 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.
Expand Down