master- Sync Repo

This commit is contained in:
Mali Bayhan 2021-12-10 14:55:34 -08:00
parent 7f6ee5a1bc
commit 7430de4f86

View File

@ -1,41 +1,23 @@
#!groovy #!groovy
def MAVEN_IMAGE = 'maven:3.8.2-openjdk-11-slim'
pipeline { pipeline {
agent { agent any
docker {
image "${MAVEN_IMAGE}"
}
}
stages { stages {
stage ('Build') { stage ('Build') {
steps { steps {
// dir('user-service') { dir('user-service') {
sh 'mvn clean verify ' + sh '../mvnw clean verify ' +
"-Dpact.provider.version=${GIT_COMMIT} " + "-Dpact.provider.version=${GIT_COMMIT} " +
'-Dpact.verifier.publishResults=true' '-Dpact.verifier.publishResults=true'
// }
}
}
stage('Static Code Analysis') {
steps {
withSonarQubeEnv('cicd') {
sh 'mvn sonar:sonar'
} }
} }
} }
stage('Check Pact Verifications') { stage('Check Pact Verifications') {
steps { steps {
sh 'cp files/cacert.pem /tmp' sh 'curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.3/pact-1.88.3-linux-x86_64.tar.gz'
withEnv(['SSL_CERT_FILE=/tmp/cacert.pem']) { sh 'tar xzf pact-1.88.3-linux-x86_64.tar.gz'
sh 'curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.3/pact-1.88.3-linux-x86_64.tar.gz' dir('pact/bin') {
sh 'tar xzf pact-1.88.3-linux-x86_64.tar.gz' sh "./pact-broker can-i-deploy -a user-service -b http://pact_broker -e ${GIT_COMMIT}"
dir('pact/bin') {
sh "./pact-broker can-i-deploy -a user-service -b https://pact.bayhan.ca -e ${GIT_COMMIT}"
}
} }
} }
} }