pact-test Sync Repo

This commit is contained in:
Mali Bayhan 2021-12-10 08:59:54 -08:00
parent b31c0ad485
commit 1da2d025a9

35
Jenkinsfile vendored
View File

@ -1,7 +1,13 @@
def MAVEN_IMAGE = 'maven:3.8.2-openjdk-11-slim' def MAVEN_IMAGE = 'maven:3.8.2-openjdk-11-slim'
pipeline { pipeline {
agent any // agent any
agent {
docker {
image "${MAVEN_IMAGE}"
}
}
environment { environment {
BRANCH_NAME = env.GIT_BRANCH.replace('origin/', '') BRANCH_NAME = env.GIT_BRANCH.replace('origin/', '')
@ -9,11 +15,11 @@ pipeline {
stages { stages {
stage('Build') { stage('Build') {
agent { // agent {
docker { // docker {
image "${MAVEN_IMAGE}" // image "${MAVEN_IMAGE}"
} // }
} // }
steps { steps {
git 'https://github.com/mabayhan/sonarqubejava' git 'https://github.com/mabayhan/sonarqubejava'
sh 'mvn -Dmaven.test.failure.ignore=true clean package' sh 'mvn -Dmaven.test.failure.ignore=true clean package'
@ -30,11 +36,11 @@ pipeline {
stage('Static Code Analysis') { stage('Static Code Analysis') {
// maven:start // maven:start
agent { // agent {
docker { // docker {
image "${MAVEN_IMAGE}" // image "${MAVEN_IMAGE}"
} // }
} // }
steps { steps {
withSonarQubeEnv('cicd') { withSonarQubeEnv('cicd') {
@ -49,6 +55,13 @@ pipeline {
} }
stage('Pact'){ stage('Pact'){
// agent {
// docker {
// image "${MAVEN_IMAGE}"
// }
// }
steps{ steps{
sh 'mvn pact:publish -Dpact.consumer.version=${GIT_COMMIT} -Dpact.tag=${BRANCH_NAME}' sh 'mvn pact:publish -Dpact.consumer.version=${GIT_COMMIT} -Dpact.tag=${BRANCH_NAME}'
} }