52 lines
1.2 KiB
Plaintext
Raw Normal View History

2021-12-10 09:49:13 -08:00
#!groovy
2021-12-10 10:16:37 -08:00
def MAVEN_IMAGE = 'maven:3.8.2-openjdk-11-slim'
2021-12-10 09:49:13 -08:00
2021-12-10 10:16:37 -08:00
pipeline {
agent {
docker {
image "${MAVEN_IMAGE}"
}
}
2021-12-10 09:49:13 -08:00
stages {
stage ('Build') {
steps {
2021-12-10 11:48:50 -08:00
// dir('user-service') {
2021-12-10 10:16:37 -08:00
sh 'mvn clean verify ' +
2021-12-10 09:49:13 -08:00
"-Dpact.provider.version=${GIT_COMMIT} " +
2021-12-10 10:16:37 -08:00
'-Dpact.verifier.publishResults=true'
2021-12-10 11:48:50 -08:00
// }
2021-12-10 09:49:13 -08:00
}
}
2021-12-10 11:48:50 -08:00
stage('Static Code Analysis') {
steps {
withSonarQubeEnv('cicd') {
sh 'mvn sonar:sonar'
}
}
2021-12-10 11:52:55 -08:00
}
2021-12-10 11:48:50 -08:00
2021-12-10 09:49:13 -08:00
stage('Check Pact Verifications') {
steps {
2021-12-10 14:54:40 -08:00
sh 'cp files/cacert.pem /tmp'
withEnv(['SSL_CERT_FILE=/tmp/cacert.pem']) {
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'
sh 'tar xzf pact-1.88.3-linux-x86_64.tar.gz'
dir('pact/bin') {
sh "./pact-broker can-i-deploy -a user-service -b https://pact.bayhan.ca -e ${GIT_COMMIT}"
}
2021-12-10 09:49:13 -08:00
}
}
}
stage('Deploy') {
when {
branch 'junit5'
}
steps {
echo 'Deploying to prod now...'
}
}
}
2021-12-10 14:54:40 -08:00
}