|
|
@ -16,7 +16,12 @@ node() { |
|
|
openapi: [filename: "testcase-01/swagger.json"], |
|
|
openapi: [filename: "testcase-01/swagger.json"], |
|
|
environment: [baseSystemName: toolbox.generateRandomBaseSystemName()], |
|
|
environment: [baseSystemName: toolbox.generateRandomBaseSystemName()], |
|
|
toolbox: [openshiftProject: params.NAMESPACE, destination: params.TARGET_INSTANCE, secretName: params.SECRET_NAME], |
|
|
toolbox: [openshiftProject: params.NAMESPACE, destination: params.TARGET_INSTANCE, secretName: params.SECRET_NAME], |
|
|
service: [:] |
|
|
service: [:], |
|
|
|
|
|
applicationPlans: [ |
|
|
|
|
|
[ systemName: "test", name: "Test", defaultPlan: true, published: true ], |
|
|
|
|
|
[ systemName: "silver", name: "Silver" ], |
|
|
|
|
|
[ systemName: "gold", name: "Gold" ], |
|
|
|
|
|
] |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
echo "toolbox version = " + service.toolbox.getToolboxVersion() |
|
|
echo "toolbox version = " + service.toolbox.getToolboxVersion() |
|
|
@ -27,66 +32,32 @@ node() { |
|
|
echo "Service with system_name ${service.environment.targetSystemName} created !" |
|
|
echo "Service with system_name ${service.environment.targetSystemName} created !" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
stage("Create an Application Plan") { |
|
|
stage("Create an Application Plan") { |
|
|
openshift.withCluster() { |
|
|
service.applyApplicationPlans() |
|
|
openshift.withProject(params.NAMESPACE) { |
|
|
|
|
|
toolbox.applyApplicationPlan(openshift: openshift, |
|
|
|
|
|
destination: params.TARGET_INSTANCE, |
|
|
|
|
|
serviceSystemName: targetSystemName, |
|
|
|
|
|
planSystemName: "test_plan", |
|
|
|
|
|
planDisplayName: "Test Plan", |
|
|
|
|
|
toolboxConfig: toolboxConfig) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
stage("Create an Application") { |
|
|
stage("Create an Application") { |
|
|
openshift.withCluster() { |
|
|
def testApplication = [ |
|
|
openshift.withProject(params.NAMESPACE) { |
|
|
name: "my-test-app", |
|
|
testApplicationCredentials = toolbox.getDefaultApplicationCredentials(serviceSystemName: targetSystemName, |
|
|
description: "This is used for tests" |
|
|
applicationName: testApplicationName, |
|
|
] |
|
|
toolboxConfig: toolboxConfig) |
|
|
|
|
|
toolbox.applyApplication(openshift: openshift, |
|
|
def testApplicationCredentials = toolbox.getDefaultApplicationCredentials(service, testApplication.name) |
|
|
destination: params.TARGET_INSTANCE, |
|
|
service.applyApplication(testApplication + testApplicationCredentials) |
|
|
serviceSystemName: targetSystemName, |
|
|
|
|
|
planSystemName: "test_plan", |
|
|
|
|
|
applicationName: testApplicationName, |
|
|
|
|
|
applicationDescription: "Test", |
|
|
|
|
|
applicationCredentials: testApplicationCredentials |
|
|
|
|
|
toolboxConfig: toolboxConfig) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
stage("Run integration tests") { |
|
|
stage("Run integration tests") { |
|
|
openshift.withCluster() { |
|
|
|
|
|
openshift.withProject(params.NAMESPACE) { |
|
|
|
|
|
// To run the integration tests when using APIcast SaaS instances, we need |
|
|
// To run the integration tests when using APIcast SaaS instances, we need |
|
|
// to fetch the proxy definition to extract the staging public url |
|
|
// to fetch the proxy definition to extract the staging public url |
|
|
def proxy = toolbox.readProxy(openshift: openshift, |
|
|
def proxy = service.readProxy() |
|
|
destination: params.TARGET_INSTANCE, |
|
|
|
|
|
serviceSystemName: targetSystemName, |
|
|
|
|
|
environment: "sandbox", |
|
|
|
|
|
toolboxConfig: toolboxConfig) |
|
|
|
|
|
sh '''set -xe |
|
|
sh '''set -xe |
|
|
curl ${proxy.sandbox_endpoint}/beers |
|
|
curl ${proxy.sandbox_endpoint}/beers |
|
|
# TODO |
|
|
# TODO |
|
|
''' |
|
|
''' |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
stage("Promote to production") { |
|
|
stage("Promote to production") { |
|
|
openshift.withCluster() { |
|
|
service.promoteToProduction() |
|
|
openshift.withProject(params.NAMESPACE) { |
|
|
|
|
|
toolbox.promoteToProduction(openshift: openshift, |
|
|
|
|
|
destination: params.TARGET_INSTANCE, |
|
|
|
|
|
serviceSystemName: targetSystemName, |
|
|
|
|
|
toolboxConfig: toolboxConfig) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|