Skip to content

Instantly share code, notes, and snippets.

@vinirib
Created July 1, 2020 16:52
Show Gist options
  • Save vinirib/212ce7e28b338a0379d74e656d2702c7 to your computer and use it in GitHub Desktop.
Save vinirib/212ce7e28b338a0379d74e656d2702c7 to your computer and use it in GitHub Desktop.
#!groovy
pipeline {
agent any
environment {
BRANCH_NAME=env.GIT_BRANCH.replace("origin/", "")
}
stages {
stage('Can-I-Deploy Integration Check') {
steps {
sh 'curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.83.0/pact-1.83.0-linux-x86_64.tar.gz'
sh 'tar xzf pact-1.83.0-linux-x86_64.tar.gz'
dir('pact/bin') {
sh """./pact-broker can-i-deploy --retry-while-unknown=12 --retry-interval=10 --pacticipant ClientConsumer --latest CONTRACT-TEST --broker-base-url http://pact_broker"""
}
}
}
stage('Deploy') {
when {
branch 'master'
}
steps {
echo 'Deploying to prod now...'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment