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

Develop #180

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
47 changes: 47 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
pipeline {
agent any
tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "M3"
}
stages {
stage ('Checkout') {
steps {
git branch: 'main',
url: 'https://github.com/rudranshrocks7/pipelines-java.git'
}
}
stage('Build') {
steps {
sh "mvn -Dmaven.test.failure.ignore=true clean package"
}
}
stage('Install') {
steps {
sh "mvn install"
}
}
stage ('Deploy') {
when {
branch 'main'
}
steps {
echo "Deploying"
deploy adapters: [tomcat9 (
credentialsId: 'tomcat',
path: '',
url: 'http://74.249.99.250:8088/'
)],
contextPath: 'finalTest',
onFailure: 'false',
war: '**/*.war'
}
post {
success {
junit '**/target/surefire-reports/TEST-*.xml'
archiveArtifacts 'target/*.war'
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/microsoft/demo/Demo.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
public class Demo {
public void DoSomething(boolean flag){
if(flag){
System.out.println("I am covered");
System.out.println("I am covered Yes");
return;
}

System.out.println("I am not covered");
}
}
}