Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
63 changes: 63 additions & 0 deletions Jenkinsfiles-declarative
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
pipeline{
agent any
tools {
maven "maven3.8.6"
}
stages {
stage('1GetCode'){
steps{
sh "echo 'cloning the latest application version' "
git branch: 'feature', credentialsId: 'GitHubCredentials', url: 'https://github.com/annkessy/maven-web-application'
}
}
stage('3Test+Build'){
steps{
sh "echo 'running JUnit-test-cases' "
sh "echo 'testing must pass to create artifacts ' "
sh "mvn clean package"
}
}
stage('4CodeQuality'){
steps{
sh "echo 'Perfoming CodeQualityAnalysis' "
sh "mvn sonar:sonar"
}
}
stage('5uploadNexus'){
steps{
sh "mvn deploy"
}
}
stage('8deploy2prod'){
steps{
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://13.57.51.137:8080/')], contextPath: null, war: 'target/*war'
}
}
}
post{
always{
emailext body: '''Hey guys
Please check build status.

Thanks
Landmark
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
success{
emailext body: '''Hey guys
Good job build and deployment is successful.

Thanks
Annkessy
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
failure{
emailext body: '''Hey guys
Build failed. Please resolve issues.

Thanks
Annkessy
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
}
}
63 changes: 63 additions & 0 deletions Jenkinsfiles-declarative29
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
pipeline{
agent any
tools {
maven "maven3.8.6"
}
stages {
stage('1GetCode'){
steps{
sh "echo 'cloning the latest application version' "
git branch: 'feature', credentialsId: 'GitHubCredentials', url: 'https://github.com/annkessy/maven-web-application'
}
}
stage('3Test+Build'){
steps{
sh "echo 'running JUnit-test-cases' "
sh "echo 'testing must pass to create artifacts ' "
sh "mvn clean package"
}
}
stage('4CodeQuality'){
steps{
sh "echo 'Perfoming CodeQualityAnalysis' "
sh "mvn sonar:sonar"
}
}
stage('5uploadNexus'){
steps{
sh "mvn deploy"
}
}
stage('8deploy2prod'){
steps{
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://13.57.51.137:8080/')], contextPath: null, war: 'target/*war'
}
}
}
post{
always{
emailext body: '''Hey guys
Please check build status.

Thanks
Landmark
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
success{
emailext body: '''Hey guys
Good job build and deployment is successful.

Thanks
Annkessy
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
failure{
emailext body: '''Hey guys
Build failed. Please resolve issues.

Thanks
Annkessy
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
}
}
40 changes: 40 additions & 0 deletions Jenkinsfiles-scripted29
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
node{
def mavenHome = tool name: 'maven3.8.6'
stage('1cloneCode'){
git "https://github.com/LandmakTechnology/maven-web-application"
}
stage('2Test&Build'){
sh "${mavenHome}/bin/mvn clean package"
//bat "${mavenHome}/bin/mvn clean package"
}
stage('3codeQuality'){
sh "${mavenHome}/bin/mvn clean sonar:sonar"
}
stage('4uploadArtifacts'){
//sh "${mavenHome}/bin/mvn deploy"
//http://52.53.227.31:8191/landmark/repository/tesla-fe-snapshots/
//http://52.53.227.31:8191/landmark/repository/tesla-fe-releases/
// vi pom.xml and added repository details
// vi setting.xml and add AUTHENTICATION details
}
stage('5deploy2UAT'){
sh "echo 'deploy to UAT' "
deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war'
}
stage('6approvalGate'){
sh "echo 'ready for review' "
timeout(time:5, unit:'DAYS') {
input message: 'Application ready for deployment, Please review and approve'
}
}
stage('7deploy2Prod'){
deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war'
}
stage('8emailNotification'){
emailext body: '''Hi All,

Check Build status.

Landmark Technologies''', recipientProviders: [buildUser(), developers(), upstreamDevelopers(), brokenBuildSuspects(), brokenTestsSuspects(), contributor()], subject: 'build status', to: '[email protected]'
}
}
Loading