From 8e99bd4c63296294adab971953ecc1d3438d18b0 Mon Sep 17 00:00:00 2001 From: Noack Date: Thu, 7 Feb 2019 13:57:57 +0100 Subject: [PATCH 1/9] Add CAP scenario --- documentation/docs/scenarios/CAP_Scenario.md | 61 ++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 documentation/docs/scenarios/CAP_Scenario.md diff --git a/documentation/docs/scenarios/CAP_Scenario.md b/documentation/docs/scenarios/CAP_Scenario.md new file mode 100644 index 000000000..250f9063f --- /dev/null +++ b/documentation/docs/scenarios/CAP_Scenario.md @@ -0,0 +1,61 @@ +# Build and Deploy Applications Following the SAP Cloud Platform Application Programming Model + +Set up a basic continuous delivery process for applications that follow the SAP Cloud Platform Application Programming Model. + +## Prerequisites + +* You have an account in the Cloud Foundry environment. See [Accounts](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/8ed4a705efa0431b910056c0acdbf377.html). +* You have downloaded and installed the Cloud Foundry command line interface (CLI). See ([Download and Install the Cloud Foundry Command Line Interface](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/afc3f643ec6942a283daad6cdf1b4936.html). +* You have installed the multi-target application plug-in for the Cloud Foundry command line interface. See [Install the Multi-Target Application Plug-in in the Cloud Foundry Environment](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/27f3af39c2584d4ea8c15ba8c282fd75.html). +* You have installed the Java Runtime Environment 8. +* You have installed Jenkins 2.60.3 or higher. +* You have set up Project “Piper”. See [README](https://github.com/SAP/jenkins-library/blob/master/README.md). +* You have installed the Multi-Target Application (MTA) Archive Builder 1.0.6 or newer. See [SAP Development Tools](https://tools.hana.ondemand.com/#cloud). +* You have installed Node.js including node and npm. See [Node.js](https://nodejs.org/en/download/). + +## Context + +The Application Programming Model for SAP Cloud Platform is a best practice guide for developing applications on SAP Cloud Platform and provides a set of enterprise-grade tools, languages, and libraries. + +In this scenario, we want to show how to implement a basic continuous delivery process for applications that follow this model with the help of project "Piper" on Jenkins. + +## Example + +### Jenkinsfile + +```groovy +@Library('piper-library-os') _ + +node(){ + stage('Prepare') { + deleteDir() + checkout scm + setupCommonPipelineEnvironment script:this + } stage('Build') { + mtaBuild script:this, + buildTarget:'CF' + } stage('Deploy') { + cloudFoundryDeploy script:this, + deployTool:'mtaDeployPlugin' + } +} +``` + +### Configuration (`.pipeline/config.yml`) + +```yaml +steps: + cloudFoundryDeploy: + cloudFoundry: + credentialsId: 'CF' + apiEndpoint: '' + org: '' + space: '' +``` + +### Parameters + +For the detailed description of the relevant parameters, see: + +* [mtaBuild](https://sap.github.io/jenkins-library/steps/mtaBuild/) +* [cloudFoundryDeploy](https://sap.github.io/jenkins-library/steps/cloudFoundryDeploy/) From 287eab8faea3c40e82fe2efc8eabcacd1171461c Mon Sep 17 00:00:00 2001 From: SarahNoack <44202907+SarahNoack@users.noreply.github.com> Date: Thu, 7 Feb 2019 16:16:10 +0100 Subject: [PATCH 2/9] Rework scenario --- documentation/docs/scenarios/CAP_Scenario.md | 28 +++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/documentation/docs/scenarios/CAP_Scenario.md b/documentation/docs/scenarios/CAP_Scenario.md index 250f9063f..a4e30a94e 100644 --- a/documentation/docs/scenarios/CAP_Scenario.md +++ b/documentation/docs/scenarios/CAP_Scenario.md @@ -1,11 +1,11 @@ -# Build and Deploy Applications Following the SAP Cloud Platform Application Programming Model +# Build and Deploy Applications with Jenkins and the SAP Cloud Platform Application Programming Model -Set up a basic continuous delivery process for applications that follow the SAP Cloud Platform Application Programming Model. +Set up a basic continuous delivery process for developing applications according to the SAP Cloud Platform Application Programming Model. ## Prerequisites * You have an account in the Cloud Foundry environment. See [Accounts](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/8ed4a705efa0431b910056c0acdbf377.html). -* You have downloaded and installed the Cloud Foundry command line interface (CLI). See ([Download and Install the Cloud Foundry Command Line Interface](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/afc3f643ec6942a283daad6cdf1b4936.html). +* You have downloaded and installed the Cloud Foundry command line interface (CLI). See [Download and Install the Cloud Foundry Command Line Interface](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/afc3f643ec6942a283daad6cdf1b4936.html). * You have installed the multi-target application plug-in for the Cloud Foundry command line interface. See [Install the Multi-Target Application Plug-in in the Cloud Foundry Environment](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/27f3af39c2584d4ea8c15ba8c282fd75.html). * You have installed the Java Runtime Environment 8. * You have installed Jenkins 2.60.3 or higher. @@ -15,9 +15,9 @@ Set up a basic continuous delivery process for applications that follow the SAP ## Context -The Application Programming Model for SAP Cloud Platform is a best practice guide for developing applications on SAP Cloud Platform and provides a set of enterprise-grade tools, languages, and libraries. +The Application Programming Model for SAP Cloud Platform is a best practice guide for developing applications on SAP Cloud Platform and provides a supportive set of enterprise-grade tools, languages, and libraries. For more information about the SAP Cloud Platform Application Programming Model, see [Cloud Application Programming Model](https://help.sap.com/viewer/DRAFT/6e4c629e38154da99f972fd769252768/Development/en-US). -In this scenario, we want to show how to implement a basic continuous delivery process for applications that follow this model with the help of project "Piper" on Jenkins. +In this scenario, we want to show how to implement a basic continuous delivery process for developing applications according to this model with the help of project "Piper" on Jenkins. ## Example @@ -29,14 +29,16 @@ In this scenario, we want to show how to implement a basic continuous delivery p node(){ stage('Prepare') { deleteDir() - checkout scm - setupCommonPipelineEnvironment script:this - } stage('Build') { - mtaBuild script:this, - buildTarget:'CF' - } stage('Deploy') { - cloudFoundryDeploy script:this, - deployTool:'mtaDeployPlugin' + checkout scm + setupCommonPipelineEnvironment script:this + } + + stage('Build') { + mtaBuild script:this, buildTarget:'CF' + } + + stage('Deploy') { + cloudFoundryDeploy script:this, deployTool:'mtaDeployPlugin' } } ``` From 214bc7a7c321a2f1879acfd3cf605c66993a0cf9 Mon Sep 17 00:00:00 2001 From: SarahNoack <44202907+SarahNoack@users.noreply.github.com> Date: Thu, 7 Feb 2019 16:33:33 +0100 Subject: [PATCH 3/9] Make minor linguistic changes --- documentation/docs/scenarios/CAP_Scenario.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/documentation/docs/scenarios/CAP_Scenario.md b/documentation/docs/scenarios/CAP_Scenario.md index a4e30a94e..709b76756 100644 --- a/documentation/docs/scenarios/CAP_Scenario.md +++ b/documentation/docs/scenarios/CAP_Scenario.md @@ -1,6 +1,6 @@ -# Build and Deploy Applications with Jenkins and the SAP Cloud Platform Application Programming Model +# Build and Deploy Applications with Jenkins and the SAP Cloud Application Programming Model -Set up a basic continuous delivery process for developing applications according to the SAP Cloud Platform Application Programming Model. +Set up a basic continuous delivery process for developing applications according to the SAP Cloud Application Programming Model. ## Prerequisites @@ -15,9 +15,11 @@ Set up a basic continuous delivery process for developing applications according ## Context -The Application Programming Model for SAP Cloud Platform is a best practice guide for developing applications on SAP Cloud Platform and provides a supportive set of enterprise-grade tools, languages, and libraries. For more information about the SAP Cloud Platform Application Programming Model, see [Cloud Application Programming Model](https://help.sap.com/viewer/DRAFT/6e4c629e38154da99f972fd769252768/Development/en-US). +The Application Programming Model for SAP Cloud Platform is an end-to-end best practice guide for developing applications on SAP Cloud Platform and provides a supportive set of APIs, languages, and libraries. For more information about the SAP Cloud Application Programming Model, see [Working with the SAP Cloud Application Programming Model](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/00823f91779d4d42aa29a498e0535cdf.html). -In this scenario, we want to show how to implement a basic continuous delivery process for developing applications according to this model with the help of project "Piper" on Jenkins. +In this scenario, we want to show how to implement a basic continuous delivery process for developing applications according to this programming model with the help of project "Piper" on Jenkins. + +**Note**: This document does not provide you with a fully developed continuous integration (CI) and continuous delivery (CD) pipeline but describes a basic scenario to implement automatisation, which you can adapt and enrich according to your specific needs. ## Example From ed99ac6bf756aaff80663259f77452f848b9ba88 Mon Sep 17 00:00:00 2001 From: SarahNoack <44202907+SarahNoack@users.noreply.github.com> Date: Thu, 7 Feb 2019 16:42:18 +0100 Subject: [PATCH 4/9] Fix code climate issues --- documentation/docs/scenarios/CAP_Scenario.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/documentation/docs/scenarios/CAP_Scenario.md b/documentation/docs/scenarios/CAP_Scenario.md index 709b76756..3caa43dbc 100644 --- a/documentation/docs/scenarios/CAP_Scenario.md +++ b/documentation/docs/scenarios/CAP_Scenario.md @@ -28,20 +28,20 @@ In this scenario, we want to show how to implement a basic continuous delivery p ```groovy @Library('piper-library-os') _ -node(){ - stage('Prepare') { +node(){ + stage('Prepare') { deleteDir() checkout scm setupCommonPipelineEnvironment script:this - } - - stage('Build') { + } + + stage('Build') { mtaBuild script:this, buildTarget:'CF' - } - - stage('Deploy') { + } + + stage('Deploy') { cloudFoundryDeploy script:this, deployTool:'mtaDeployPlugin' - } + } } ``` From b186e95dec2338b6e65e5eb17ed98c0f5c87c9e4 Mon Sep 17 00:00:00 2001 From: SarahNoack <44202907+SarahNoack@users.noreply.github.com> Date: Thu, 7 Feb 2019 16:44:04 +0100 Subject: [PATCH 5/9] Fix another code climate issue --- documentation/docs/scenarios/CAP_Scenario.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/scenarios/CAP_Scenario.md b/documentation/docs/scenarios/CAP_Scenario.md index 3caa43dbc..ac01ee328 100644 --- a/documentation/docs/scenarios/CAP_Scenario.md +++ b/documentation/docs/scenarios/CAP_Scenario.md @@ -34,7 +34,7 @@ node(){ checkout scm setupCommonPipelineEnvironment script:this } - + stage('Build') { mtaBuild script:this, buildTarget:'CF' } From 40ff8fa2e3ae1f84e08f353d6e0f8745e98bcc80 Mon Sep 17 00:00:00 2001 From: Christoph Szymanski Date: Fri, 8 Feb 2019 13:09:30 +0100 Subject: [PATCH 6/9] Build Target from Parameter to Configuration as discussed with @marcusholl --- documentation/docs/scenarios/CAP_Scenario.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/docs/scenarios/CAP_Scenario.md b/documentation/docs/scenarios/CAP_Scenario.md index ac01ee328..60899b398 100644 --- a/documentation/docs/scenarios/CAP_Scenario.md +++ b/documentation/docs/scenarios/CAP_Scenario.md @@ -49,6 +49,8 @@ node(){ ```yaml steps: + mtaBuild + buildTarget: 'CF' cloudFoundryDeploy: cloudFoundry: credentialsId: 'CF' From 5d0daafe00eec0ed378e6cf3d6ae125bf4988e92 Mon Sep 17 00:00:00 2001 From: SarahNoack <44202907+SarahNoack@users.noreply.github.com> Date: Fri, 8 Feb 2019 13:43:33 +0100 Subject: [PATCH 7/9] Remove note Exchange note that this is a basic scenario with a single sentence in the paragraph before --- documentation/docs/scenarios/CAP_Scenario.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/documentation/docs/scenarios/CAP_Scenario.md b/documentation/docs/scenarios/CAP_Scenario.md index 60899b398..0ab561b43 100644 --- a/documentation/docs/scenarios/CAP_Scenario.md +++ b/documentation/docs/scenarios/CAP_Scenario.md @@ -17,9 +17,7 @@ Set up a basic continuous delivery process for developing applications according The Application Programming Model for SAP Cloud Platform is an end-to-end best practice guide for developing applications on SAP Cloud Platform and provides a supportive set of APIs, languages, and libraries. For more information about the SAP Cloud Application Programming Model, see [Working with the SAP Cloud Application Programming Model](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/00823f91779d4d42aa29a498e0535cdf.html). -In this scenario, we want to show how to implement a basic continuous delivery process for developing applications according to this programming model with the help of project "Piper" on Jenkins. - -**Note**: This document does not provide you with a fully developed continuous integration (CI) and continuous delivery (CD) pipeline but describes a basic scenario to implement automatisation, which you can adapt and enrich according to your specific needs. +In this scenario, we want to show how to implement a basic continuous delivery process for developing applications according to this programming model with the help of project "Piper" on Jenkins. This basic scenario can be adapted and enriched according to your specific needs. ## Example From a5597a447cd5cb872ecf4453183fb9e497378fcf Mon Sep 17 00:00:00 2001 From: SarahNoack <44202907+SarahNoack@users.noreply.github.com> Date: Fri, 8 Feb 2019 13:48:09 +0100 Subject: [PATCH 8/9] Add SAP CP to CF account --- documentation/docs/scenarios/CAP_Scenario.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/scenarios/CAP_Scenario.md b/documentation/docs/scenarios/CAP_Scenario.md index 0ab561b43..9196f873a 100644 --- a/documentation/docs/scenarios/CAP_Scenario.md +++ b/documentation/docs/scenarios/CAP_Scenario.md @@ -4,7 +4,7 @@ Set up a basic continuous delivery process for developing applications according ## Prerequisites -* You have an account in the Cloud Foundry environment. See [Accounts](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/8ed4a705efa0431b910056c0acdbf377.html). +* You have an account on SAP Cloud Platform in the Cloud Foundry environment. See [Accounts](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/8ed4a705efa0431b910056c0acdbf377.html). * You have downloaded and installed the Cloud Foundry command line interface (CLI). See [Download and Install the Cloud Foundry Command Line Interface](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/afc3f643ec6942a283daad6cdf1b4936.html). * You have installed the multi-target application plug-in for the Cloud Foundry command line interface. See [Install the Multi-Target Application Plug-in in the Cloud Foundry Environment](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/27f3af39c2584d4ea8c15ba8c282fd75.html). * You have installed the Java Runtime Environment 8. From 04c0316983f5ede0e8a4c4dbbd75c2043e443c48 Mon Sep 17 00:00:00 2001 From: SarahNoack <44202907+SarahNoack@users.noreply.github.com> Date: Fri, 8 Feb 2019 13:51:41 +0100 Subject: [PATCH 9/9] Remove ", buildTarget:'CF'" Remove ", buildTarget:'CF'" from Jenkinsfile example --- documentation/docs/scenarios/CAP_Scenario.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/scenarios/CAP_Scenario.md b/documentation/docs/scenarios/CAP_Scenario.md index 9196f873a..32a9d8164 100644 --- a/documentation/docs/scenarios/CAP_Scenario.md +++ b/documentation/docs/scenarios/CAP_Scenario.md @@ -34,7 +34,7 @@ node(){ } stage('Build') { - mtaBuild script:this, buildTarget:'CF' + mtaBuild script:this } stage('Deploy') {