mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-01-27 18:20:05 +00:00
- It modifies the Dockerfile and entrypoint slightly to allow for OpenShift SCCs to operate correctly - It adds 2 template examples that can be easily modified by changing parameters Fixes #572
44 lines
1.2 KiB
Groovy
44 lines
1.2 KiB
Groovy
pipeline {
|
|
agent any
|
|
stages {
|
|
stage ('Deploy test pod'){
|
|
when {
|
|
expression {
|
|
openshift.withCluster() {
|
|
openshift.withProject() {
|
|
return !openshift.selector( "dc", "pgbench" ).exists()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
steps {
|
|
script {
|
|
openshift.withCluster() {
|
|
openshift.withProject() {
|
|
def pgbench = openshift.newApp( "https://github.com/stewartshea/docker-pgbench/", "--name=pgbench", "-e PGPASSWORD=postgres", "-e PGUSER=postgres", "-e PGHOST=patroni-persistent-master", "-e PGDATABASE=postgres", "-e TEST_CLIENT_COUNT=20", "-e TEST_DURATION=120" )
|
|
def pgbenchdc = openshift.selector( "dc", "pgbench" )
|
|
timeout(5) {
|
|
pgbenchdc.rollout().status()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage ('Run benchmark Test'){
|
|
steps {
|
|
sh '''
|
|
oc exec $(oc get pods -l app=pgbench | grep Running | awk '{print $1}') ./test.sh
|
|
'''
|
|
}
|
|
}
|
|
stage ('Clean up pgtest pod'){
|
|
steps {
|
|
sh '''
|
|
oc delete all -l app=pgbench
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
}
|