Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
Merge branch 'prepare-release' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
s4sdkJenkinsBot committed Jan 16, 2020
2 parents 6f67b40 + 73ed110 commit eacd5a0
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 68 deletions.
2 changes: 1 addition & 1 deletion NOTICE
@@ -1 +1 @@
Copyright (c) 2017-2019 SAP SE or an SAP affiliate company. All rights reserved.
Copyright (c) 2017-2020 SAP SE or an SAP affiliate company. All rights reserved.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -12,7 +12,7 @@ The pipeline supports the following types of projects:
* Java projects based on the [SAP Cloud SDK Archetypes](https://mvnrepository.com/artifact/com.sap.cloud.sdk.archetypes).
* JavaScript projects based on the [SAP Cloud SDK JavaScript Scaffolding](https://github.com/SAP/cloud-s4-sdk-examples/tree/scaffolding-js).
* TypeScript projects based on the [SAP Cloud SDK TypeScript Scaffolding](https://github.com/SAP/cloud-s4-sdk-examples/tree/scaffolding-ts).
* SAP Cloud Application Programming Model (CAP) projects based on the _SAP Cloud Platform Business Application_ SAP Web IDE Template.
* SAP Cloud Application Programming Model (CAP) projects based on the _SAP Cloud Platform Business Application_ SAP Web IDE Template.

You can find more details about the supported project types and build tools in our [documentation](doc/pipeline/build-tools.md).

Expand Down Expand Up @@ -63,7 +63,7 @@ After that you can start the Jenkins server with following command:
./cx-server start
```

In Jenkins, click on "New Item" and create a new "Multi-branch Pipeline" for your repository.
In Jenkins, click on "New Item" and create a new "Multi-branch Pipeline" for your repository.

### Versioning

Expand Down Expand Up @@ -100,7 +100,7 @@ Be sure to remove any confidential information before.
If you need any support, have any question or have found a bug, please report it as an issue in the repository.

## License
Copyright (c) 2017-2019 SAP SE or an SAP affiliate company. All rights reserved.
Copyright (c) 2017-2020 SAP SE or an SAP affiliate company. All rights reserved.
This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE file](LICENSE).

Note: This license does not apply to the SAP Cloud SDK for Continuous Delivery Logo referenced in this README.
6 changes: 3 additions & 3 deletions configuration.md
Expand Up @@ -388,7 +388,7 @@ productionDeployment:
The MTA projects can make use of the extension files and one can use a Jenkins credential store to inject the credentials during runtime instead of storing them as a plain text in the extension file.
In order to use this feature, use a [JSP style or GString style](http://docs.groovy-lang.org/latest/html/api/groovy/text/GStringTemplateEngine.html) place holder in the extension file and provide the respective credential id in the `pipeline_config.yml` as shown below.

Please note currently only the Jenkins [Sercret text](https://jenkins.io/doc/book/using/using-credentials/) is the supported format for runtime credential substitution.
Please note currently only the Jenkins [Sercret text](https://jenkins.io/doc/book/using/using-credentials/) is the supported format for runtime credential substitution.

```yaml
#pipeline_config.yml
Expand Down Expand Up @@ -418,7 +418,7 @@ parameters:
broker-credentials: <%= brokerCredential %>
```


For `neoTargets` the following properties can be defined:

| Property | Mandatory | Default Value | Description |
Expand Down Expand Up @@ -797,7 +797,7 @@ executeFortifyScan:
| Property | Mandatory | Default Value | Description |
| --- | --- | --- | --- |
| `dockerImage` | | `ppiper/mta-archive-builder` | Docker image including Multi-target Application Archive Builder. The default image is `ppiper/mta-archive-builder` for mtaBuildTool `classic`. And it takes `devxci/mbtci:1.0.4` as a default image for mtaBuildTool `cloudMbt`. |
| `mtaBuildTool` | | `classic` | Choose which tool is used to build your mta project. The default option is `classic` uses the java based mta builder, which is deprecated. The newer version `cloudMbt` is written in go. For more information refer to https://sap.github.io/cloud-mta-build-tool. |
| `mtaBuildTool` | | `cloudMbt` | Choose which tool is used to build your mta project. The default option is `cloudMbt` which is not backwards compatible with the `classic` tool. For more information on migrating from `classic` to `cloudMbt`, please refer to https://sap.github.io/cloud-mta-build-tool/migration/. |

All configuration parameters as stated in [jenkins-library documentation](https://sap.github.io/jenkins-library/steps/mtaBuild/) are available.

Expand Down
146 changes: 86 additions & 60 deletions doc/pipeline/build-tools.md
@@ -1,46 +1,51 @@
# Build Tools

The SAP Cloud SDK supports multiple programming languages (Java and JavaScript) and can be used in the SAP Cloud Application Programming Model.
For each of these variants project templates exists.
For each of these variants project templates exists (as referenced in the project's main [Readme](../../README.md) file).
These templates introduce standard tooling, such as build tools, and a standard structure.

The SAP Cloud SDK Continuous Delivery Toolkit expects that the project follows this structure and depends on the build tools introduced by these templates.

The supported build tools are: [Maven](https://maven.apache.org/) for Java projects, [NPM](https://www.npmjs.com/) for JavaScript projects, and [MTA](https://help.sap.com/viewer/4505d0bdaf4948449b7f7379d24d0f0d/2.0.03/en-US/4486ada1af824aadaf56baebc93d0256.html) for SAP Cloud Application Programming Model.
The supported build tools are:

*Note: The JavaScript/NPM pipeline variant is in an early state. Some interfaces might change. We recommend to consume a fixed released version as described in the project [Readme](../../README.md#versioning).*
* [Maven](https://maven.apache.org/) for Java projects
* [npm](https://www.npmjs.com/) for JavaScript projects
* [MTA](https://sap.github.io/cloud-mta-build-tool) for Multi-Target Application Model projects

MTA itself makes use of other build tools, such as Maven and npm depending on what types of modules your application has.

*Note: The npm pipeline variant is in an early state. Some interfaces might change. We recommend to consume a fixed released version as described in the project [Readme](../../README.md#versioning).*

## Feature Matrix

Support for the different features of the pipeline may vary in each variant of the SDK pipeline build tool. The following table gives an overview over the features available per build tool.

| Feature | Maven | NPM | MTA |
| -------------------------- |------ | --- | --- |
| Automatic Versioning | x | | x |
| Build | x | x | x |
| Backend Integration Tests | x | x | x |
| Frontend Integration Tests | | x | |
| Backend Unit Tests | x | x | x |
| Frontend Unit Tests | x | x | x |
| NPM Dependency Audit | x | x | x |
| Linting | x | | x |
| Static Code Checks | x | | x |
| End-To-End Tests | x | | x |
| Performance Tests | x | | x |
| Resilience Checks | x | | x |
| S4HANA Public APIs | x | | x |
| CodeCoverage Checks | x | x | x |
| Checkmarx Integration | x | | x |
| Fortify Integration | x | | x |
| SourceClear Integration | x | | |
| Whitesource Integration | x | x | x |
| Deployment to Nexus | x | | x |
| Zero Downtime Deployment | x | x | x* |
| Download Cache | x | x | x |

*Note: The MTA version of the pipeline currently supports only Java based backend services.*

*MTA projects can only be deployed to the Cloud Foundry Environment
Support for the different features of the pipeline may vary in each variant of the SDK pipeline build tool.
The following table gives an overview over the features available per build tool.

| Feature | Maven | npm | MTA Maven | MTA npm |
|----------------------------|-------|-----|-----------|---------|
| Automatic Versioning | x | | x | x |
| Build | x | x | x | x |
| Backend Integration Tests | x | x | x | x |
| Frontend Integration Tests | | x | | x |
| Backend Unit Tests | x | x | x | x |
| Frontend Unit Tests | x | x | x | x |
| NPM Dependency Audit | x | x | x | x |
| Linting | x | | x | x |
| Static Code Checks | x | | x | |
| End-To-End Tests | x | | x | x |
| Performance Tests | x | | x | |
| Resilience Checks | x | | x | |
| S4HANA Public APIs | x | | x | |
| Code Coverage Checks | x | x | x | x |
| Checkmarx Integration | x | | x | |
| Fortify Integration | x | | x | |
| SourceClear Integration | x | | | |
| Whitesource Integration | x | x | x | x |
| Deployment to Nexus | x | | x | x |
| Zero Downtime Deployment | x | x |||
| Download Cache | x | x | x | x |

¹ MTA projects can only be deployed to the Cloud Foundry Environment

## Projects Requirements

Expand All @@ -51,10 +56,10 @@ In any case, please also consult the [documentation of the pipeline configuratio

### Build Tool Independent Requirements

In order to run in the pipeline your project has to include the following two files in the root folder: `Jenkinsfile` and `pipeline_config.yml`.
In order to run in the pipeline your project has to include the following two files in the root folder: `Jenkinsfile` and `pipeline_config.yml`.
You can copy both files from this [github repository](../../archetype-resources).
There are two variants of the configuration file.
Please pick the corresponding version for your deployment target and rename it properly.
There are two variants of the configuration file.
Please pick the corresponding version for your deployment target and rename it properly.

#### Frontend Unit Tests

Expand All @@ -64,17 +69,56 @@ The required format of the test result report is the JUnit format as an `.xml` f
The code coverage report can be published as html report and in the cobertura format.
The cobertura report as html report has to be stored in the directory `./s4hana_pipeline/reports/coverage-reports/frontend-unit/report-html/ut/` as an `index.html` file.
These coverage reports will then be published in Jenkins.
Furthermore, if configured in the `pipeline_config.yml`, the pipeline ensures the configured level of code coverage.
Furthermore, if configured in the `pipeline_config.yml`, the pipeline ensures the configured level of code coverage.

In MTA projects Frontend Unit Tests are executed for every module of type `html5`.

#### Frontend Integration Tests

The command `npm run ci-it-frontend` will be executed in this stage and has to be defined in the `package.json`in the root.
In this stage, the frontend should be tested end-to-end without the backend. Therefore, even a browser is started to simulate user interactions.
The command `npm run ci-it-frontend` will be executed in this stage and has to be defined in the `package.json` in the root.
In this stage, the frontend should be tested end-to-end without the backend.
Therefore, even a browser is started to simulate user interactions.
Furthermore, the test results have to be stored in the folder `./s4hana_pipeline/reports/frontend-integration` in the root directory of the project.
The required format of the test result report is the JUnit format as an `.xml` file.
The user is responsible to use a proper reporters for generating the results.
It is recommended to use the same tools as in the `package.json` of this [example project](https://github.com/SAP/cloud-s4-sdk-examples/blob/scaffolding-js/package.json).

#### Backend Unit Tests

##### Maven

In the maven module called `unit-tests` we run the command `mvn test`.

##### Java MTA modules

We run the command `mvn test` in each Java MTA module.

##### Npm and Nodejs MTA modules

For each `package.json` where the script `ci-backend-unit-test` is defined the command `npm run ci-backend-unit-test` will be executed in this stage.
Furthermore, the test results have to be stored in the folder `./s4hana_pipeline/reports/backend-unit/` in the root directory of the project.
The required format of the test result report is the JUnit format as an `.xml` file.
For the code coverage the results have to be stored in the folder `./s4hana_pipeline/reports/coverage-reports/backend-unit/` in the cobertura format as an `xml` file.
The user is responsible to use a proper reporters for generating the results.
We recommend the tools used in the `package.json` of this [example project](https://github.com/SAP/cloud-s4-sdk-examples/blob/scaffolding-js/package.json).
If you have multiple npm packages with unit tests the names of the report files must have unique names.

#### Backend Integration Tests

##### Maven and Java MTA modules

If there is a maven module called `integration-tests` we run `maven test` in this module.

##### Npm and Nodejs MTA modules

For each `package.json` where the script `ci-it-backend` is defined the command `npm run ci-it-backend` will be executed in this stage.
Furthermore, the test results have to be stored in the folder `./s4hana_pipeline/reports/backend-integration` in the root directory of the project.
The required format of the test result report is the JUnit format as an `.xml` file.
For the code coverage the results have to be stored in the folder `./s4hana_pipeline/reports/coverage-reports/backend-integration/` in the cobertura format as an `xml` file.
The user is responsible to use a proper reporters for generating the results.
We recommend the tools used in the `package.json` of this [example project](https://github.com/SAP/cloud-s4-sdk-examples/blob/scaffolding-js/package.json).
If you have multiple npm packages with unit tests the names of the report files must have unique names.

#### End-to-End Tests

This stage is only executed if you configured it in the file `pipeline_config.yml`.
Expand Down Expand Up @@ -135,10 +179,10 @@ Furthermore, the test modules have to include the following dependency:
</dependency>
```

### JavaScript / NPM
### JavaScript / npm

The project has to use NPM and include a package.json in the root directory.
In the pipeline stages, specific scripts in the package.json are called to build the project or run tests.
The project has to use npm and include a `package.json` in the root directory.
In the pipeline stages, specific scripts in the `package.json` are called to build the project or run tests.
Furthermore, the pipeline expects reports, such as test results, to be written into certain folders.
These stage specific requirements are documented below.

Expand All @@ -156,24 +200,6 @@ This directory has to be defined as path in the `manifest.yml`.

*Note: This steps runs isolated from the steps before. Thus, e.g. modifying node_modules with `npm prune --production` will not have an effect for later stages, such as the test execution.*

#### Backend Integration Tests

The command `npm run ci-it-backend` will be executed in this stage.
Furthermore, the test results have to be stored in the folder `./s4hana_pipeline/reports/backend-integration` in the root directory of the project.
The required format of the test result report is the JUnit format as an `.xml` file.
For the code coverage the results have to be stored in the folder `./s4hana_pipeline/reports/coverage-reports/backend-integration/` in the cobertura format as an `xml` file.
The user is responsible to use a proper reporters for generating the results.
We recommend the tools used in the `package.json` of this [example project](https://github.com/SAP/cloud-s4-sdk-examples/blob/scaffolding-js/package.json).

#### Backend Unit Tests

The command `npm run ci-backend-unit-test` will be executed in this stage.
Furthermore, the test results have to be stored in the folder `./s4hana_pipeline/reports/backend-unit/` in the root directory of the project.
The required format of the test result report is the JUnit format as an `.xml` file.
For the code coverage the results have to be stored in the folder `./s4hana_pipeline/reports/coverage-reports/backend-unit/` in the cobertura format as an `xml` file.
The user is responsible to use a proper reporters for generating the results.
We recommend the tools used in the `package.json` of this [example project](https://github.com/SAP/cloud-s4-sdk-examples/blob/scaffolding-js/package.json).

### SAP Cloud Application Programming Model / MTA

The project structure follows the standard structure for projects created via the _SAP Cloud Platform Business Application_ SAP Web IDE Template with some constraints.
Expand Down Expand Up @@ -217,4 +243,4 @@ In summary, the project structure should look like this:
└── src
├── main
└── test // Unit-Tests for this service
```
```
2 changes: 1 addition & 1 deletion s4sdk-pipeline.groovy
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy

final def pipelineSdkVersion = 'v27'
final def pipelineSdkVersion = 'v28'

pipeline {
agent any
Expand Down

0 comments on commit eacd5a0

Please sign in to comment.