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

Patch 2 #32

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
### Good stuff
COPY target/*.war /usr/local/tomcat/webapps/maven-web-app.war
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
*/

Expand Down
41 changes: 41 additions & 0 deletions Jenkinsfile-ebay
Original file line number Diff line number Diff line change
@@ -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'
}
*/

/*
*/

}
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]'
}


}
60 changes: 60 additions & 0 deletions Jenkinsfile_docker
Original file line number Diff line number Diff line change
@@ -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"
}
}

}
}
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:
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<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.238.135.186:9000/</sonar.host.url>
<sonar.host.url>http:3.96.67.73:7000/</sonar.host.url>
<sonar.login>admin</sonar.login>
<sonar.password>admin</sonar.password>
<sonar.password>admin123</sonar.password>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

Expand Down Expand Up @@ -97,13 +97,13 @@
<repository>
<id>nexus</id>
<name>Landmark Technologies Releases Nexus Repository</name>
<url>http://44.192.81.238:8888/mylandmarktech/repository/boa-release/</url>
<url> http://172.31.18.29:8081/repository/ebay-bts-releases/</url>
</repository>

<snapshotRepository>
<id>nexus</id>
<name>Landmark Technologies Snapshot Nexus Repository </name>
<url>http://44.192.81.238:8888/mylandmarktech/repository/boa-snapshot/</url>
<url>http://100.24.52.91:4000/repository/ebay-bts-snapshot/</url>
</snapshotRepository>

</distributionManagement>
Expand Down
Loading