Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
legah2045 authored Sep 24, 2021
1 parent 46ac861 commit 0a0b140
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 0 deletions.
83 changes: 83 additions & 0 deletions JenkinsfileDeclarative
Original file line number Diff line number Diff line change
@@ -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 [email protected]:/opt/apache-tomcat-9.0.41/webapps/"
}
}
}



}

post{


success{
mail bcc: '[email protected]', body: '''BuildOver!....

Regards,
Landmark Technologies,
9980923226''', cc: '[email protected]', from: '', replyTo: '', subject: 'BuildOver!!', to: '[email protected]'
}

failure{
mail bcc: '[email protected]', body: '''BuildOver!....

Regards,
Landmark Technologies,
+1 437 215 2483,''', cc: '[email protected]', from: '', replyTo: '', subject: 'BuildOver!!', to: '[email protected]'
}

}
}
51 changes: 51 additions & 0 deletions JenkinsfileJuly2021
Original file line number Diff line number Diff line change
@@ -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 [email protected]:/opt/apache-tomcat-9.0.52/webapps/"
}
}

*/

stage('SendEmailNotification'){
emailext body: '''Build is over !!

Regards,
Landmark Technologies,
9980923226''', subject: 'Build Over... !!', to: '[email protected]'
}


}
77 changes: 77 additions & 0 deletions JenkinsfiledeclarativeJuneBathc
Original file line number Diff line number Diff line change
@@ -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 [email protected]:/opt/apache-tomcat-9.0.50/webapps/"
}
}
}
*/
}//Stages Closing

post{

success{
emailext to: '[email protected],[email protected]',
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: '[email protected]'
}

failure{
emailext to: '[email protected],[email protected]',
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: '[email protected]'
}

}


}//Pipeline closing
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.1'
services:
springboot:
image: mylandmarktech/maven-web-app:VERSION
restart: always
ports:
- 9090:8080
networks:
- mavenappbridge
networks:
mavenappbridge:

1 comment on commit 0a0b140

@adecoker
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Please sign in to comment.