Skip to content

Instantly share code, notes, and snippets.

@borodicht
Created December 12, 2024 10:49
Show Gist options
  • Save borodicht/ac91a5b8eead032310d653ee1c1240a1 to your computer and use it in GitHub Desktop.
Save borodicht/ac91a5b8eead032310d653ee1c1240a1 to your computer and use it in GitHub Desktop.
pipeline {
agent any
tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "M3"
}
parameters {
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH'
}
stages {
stage('Test') {
steps {
// Get some code from a GitHub repository
git url: 'https://github.com/borodicht/SauceDemoQA28.git', branch: "${params.BRANCH}"
// Run Maven on a Unix agent.
sh "mvn clean test"
}
post {
// If Maven was able to run the tests, even if some of the test
// failed, record the test results and archive the jar file.
success {
junit '**/target/surefire-reports/TEST-*.xml'
}
}
}
stage('Allure Report') {
steps {
script {
allure([
includeProperties: false,
jdk: '',
properties: [],
reportBuildPolicy: 'ALWAYS',
results: [[path: 'target/allure-results']]
])
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment