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

Added conditional code for package build for master #194

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
57 changes: 57 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
pipeline {
agent {
docker {
image 'maven:3.6.3-jdk-11-slim'
}

}
stages {
stage('build') {
steps {
echo 'Compiling the code for sysfoo app'
sh 'mvn compile'
}
}

stage('Test') {
steps {
echo 'Clean test with unit test for sysfoo'
sh 'mvn clean test'
}
}

stage('Package') {
parallel {
stage('Package') {
when {
branch 'master'
}
steps {
echo 'Generating artifacts for deployment'
sh 'mvn package -DskipTests'
}
}

stage('TestA') {
steps {
sleep(time: 5, unit: 'SECONDS')
}
}

}
}

stage('TestB') {
steps {
sleep 3
}
}

}
post {
always {
echo 'This pipeline is completed..'
}

}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
This is a Sample Maven App.
Trying to push with branch rules