Browse Source

update to match the new jenkins shared library

master
Nicolas Massé 7 years ago
parent
commit
f2fc8f4c1e
  1. 47
      testcase-01/Jenkinsfile

47
testcase-01/Jenkinsfile

@ -4,42 +4,30 @@ library identifier: '3scale-toolbox-jenkins@master',
retriever: modernSCM([$class: 'GitSCMSource', retriever: modernSCM([$class: 'GitSCMSource',
remote: 'https://github.com/nmasse-itix/3scale-toolbox-jenkins.git']) remote: 'https://github.com/nmasse-itix/3scale-toolbox-jenkins.git'])
def toolboxConfig = [ def service = null
"secretName": params.SECRET_NAME
]
def baseSystemName = toolbox.generateRandomBaseSystemName()
def targetSystemName = null
node() { node() {
stage('Checkout Source') { stage('Checkout Source') {
//git url: "https://github.com/nmasse-itix/API-Lifecycle-Mockup.git"
checkout scm checkout scm
} }
stage("Get toolbox version") { stage("Prepare") {
openshift.withCluster() { service = toolbox.prepareThreescaleService(
openshift.withProject(params.NAMESPACE) { openapi: [filename: "testcase-01/swagger.json"],
echo "toolbox version = " + toolbox.getToolboxVersion(openshift: openshift) environment: [baseSystemName: toolbox.generateRandomBaseSystemName()],
} toolbox: [openshiftProject: params.NAMESPACE, destination: params.TARGET_INSTANCE, secretName: params.SECRET_NAME],
} service: [:]
)
echo "toolbox version = " + service.toolbox.getToolboxVersion()
} }
stage("Import OpenAPI") { stage("Import OpenAPI") {
openshift.withCluster() { service.importOpenAPI()
openshift.withProject(params.NAMESPACE) { echo "Service with system_name ${service.environment.targetSystemName} created !"
// Here we would need to pass the public staging/prod url when using
// APIcast Self-Managed
// See https://issues.jboss.org/browse/THREESCALE-2607
targetSystemName = toolbox.importOpenAPI(openshift: openshift,
destination: params.TARGET_INSTANCE,
toolboxConfig: toolboxConfig,
oasFile: "testcase-01/swagger.json",
baseSystemName: baseSystemName)
echo "Service with system_name ${targetSystemName} created !"
}
}
} }
/*
stage("Create an Application Plan") { stage("Create an Application Plan") {
openshift.withCluster() { openshift.withCluster() {
openshift.withProject(params.NAMESPACE) { openshift.withProject(params.NAMESPACE) {
@ -56,12 +44,16 @@ node() {
stage("Create an Application") { stage("Create an Application") {
openshift.withCluster() { openshift.withCluster() {
openshift.withProject(params.NAMESPACE) { openshift.withProject(params.NAMESPACE) {
toolbox.createApplication(openshift: openshift, testApplicationCredentials = toolbox.getDefaultApplicationCredentials(serviceSystemName: targetSystemName,
applicationName: testApplicationName,
toolboxConfig: toolboxConfig)
toolbox.applyApplication(openshift: openshift,
destination: params.TARGET_INSTANCE, destination: params.TARGET_INSTANCE,
serviceSystemName: targetSystemName, serviceSystemName: targetSystemName,
planSystemName: "test_plan", planSystemName: "test_plan",
applicationName: "My App", applicationName: testApplicationName,
applicationDescription: "Test", applicationDescription: "Test",
applicationCredentials: testApplicationCredentials
toolboxConfig: toolboxConfig) toolboxConfig: toolboxConfig)
} }
} }
@ -95,5 +87,6 @@ node() {
} }
} }
} }
*/
} }

Loading…
Cancel
Save