From 82c0fa2107942a9f56b9adc676f7ecf2d27decde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Thu, 20 Jun 2019 17:56:06 +0200 Subject: [PATCH] WiP --- testcase-02/Jenkinsfile | 2 +- testcase-03/Jenkinsfile | 64 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 testcase-03/Jenkinsfile diff --git a/testcase-02/Jenkinsfile b/testcase-02/Jenkinsfile index b7448a8..6ec75c0 100644 --- a/testcase-02/Jenkinsfile +++ b/testcase-02/Jenkinsfile @@ -23,7 +23,7 @@ node() { toolbox: [ openshiftProject: params.NAMESPACE, destination: params.TARGET_INSTANCE, image: "quay.io/redhat/3scale-toolbox:master", // TODO: remove me once the final image is released - insecure: params.DISABLE_TLS_VALIDATION != null && params.DISABLE_TLS_VALIDATION == "yes", + insecure: params.DISABLE_TLS_VALIDATION == "yes", secretName: params.SECRET_NAME], service: [:], applications: [ diff --git a/testcase-03/Jenkinsfile b/testcase-03/Jenkinsfile new file mode 100644 index 0000000..571363d --- /dev/null +++ b/testcase-03/Jenkinsfile @@ -0,0 +1,64 @@ +#!groovy + +library identifier: '3scale-toolbox-jenkins@add-new-features', + retriever: modernSCM([$class: 'GitSCMSource', + remote: 'https://github.com/nmasse-itix/3scale-toolbox-jenkins.git', + traits: [[$class: 'jenkins.plugins.git.traits.BranchDiscoveryTrait']]]) + +def service = null + +node() { + stage('Checkout Source') { + checkout scm + } + + stage("Prepare") { + service = toolbox.prepareThreescaleService( + openapi: [filename: "testcase-03/swagger.json"], + environment: [ baseSystemName: toolbox.generateRandomBaseSystemName(), + publicBasePath: "/v1", + publicStagingWildcardDomain: params.PUBLIC_STAGING_WILDCARD_DOMAIN != "" ? params.PUBLIC_STAGING_WILDCARD_DOMAIN : null, + publicProductionWildcardDomain: params.PUBLIC_PRODUCTION_WILDCARD_DOMAIN != "" ? params.PUBLIC_PRODUCTION_WILDCARD_DOMAIN : null, + oidcIssuerEndpoint: params.OIDC_ISSUER_ENDPOINT, + privateBaseUrl: params.PRIVATE_BASE_URL ], + toolbox: [ openshiftProject: params.NAMESPACE, + destination: params.TARGET_INSTANCE, + image: "quay.io/redhat/3scale-toolbox:master", // TODO: remove me once the final image is released + insecure: params.DISABLE_TLS_VALIDATION == "yes", + secretName: params.SECRET_NAME], + service: [:], + applications: [ + [ name: "my-test-app", description: "This is used for tests", plan: "test", account: params.DEVELOPER_ACCOUNT_ID ] + ], + applicationPlans: [ + [ systemName: "test", name: "Test", defaultPlan: true, published: true ], + [ systemName: "silver", name: "Silver" ], + [ systemName: "gold", name: "Gold" ], + ] + ) + + echo "toolbox version = " + service.toolbox.getToolboxVersion() + } + + stage("Import OpenAPI") { + service.importOpenAPI() + echo "Service with system_name ${service.environment.targetSystemName} created !" + } + + stage("Create an Application Plan") { + service.applyApplicationPlans() + } + + stage("Create an Application") { + service.applyApplication() + } + + stage("Run integration tests") { + // NOT IMPLEMENTED (YET) + } + + stage("Promote to production") { + service.promoteToProduction() + } + +}