mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-02-09 13:47:31 +02:00
fix some code climate issues
This commit is contained in:
parent
176c160201
commit
e2256779ba
@ -3,12 +3,15 @@
|
||||
[![Test Coverage](https://api.codeclimate.com/v1/badges/0e6a23344616e29b4ed0/test_coverage)](https://codeclimate.com/github/SAP/jenkins-library/test_coverage)
|
||||
|
||||
# Project Piper Repository
|
||||
|
||||
The Project "Piper" provides a "Shared Library" to extend the Jenkins Pipeline with SAP specific patterns. A set of clients connect SAP systems. Default pipelines offer standard processes to get your software to your customers.
|
||||
|
||||
# User Documentation
|
||||
|
||||
If you want to view the User Documentation of Project Piper please follow this [Piper Pages Link][piper-library-user-doc].
|
||||
|
||||
# Known Issues
|
||||
|
||||
A list of known issues is available on the [GitHub issues page of this project][piper-library-issues].
|
||||
|
||||
# How to obtain support
|
||||
|
@ -1,10 +1,10 @@
|
||||
# Getting Started with Project "Piper"
|
||||
|
||||
Follow this guided tour to become familiar with the basics of using project "Piper".
|
||||
Follow this guided tour to become familiar with the basics of using project "Piper".
|
||||
|
||||
The public sample application [cloud-cf-helloworld-nodejs][cloud-cf-helloworld-nodejs] will be enriched with a pipeline which syncs the sources, builds these as MTA and deploys the result into a Cloud Foundry environment. The application contains a simple `nodejs` application. Deployed as web service, it serves static data.
|
||||
The public sample application [cloud-cf-helloworld-nodejs][cloud-cf-helloworld-nodejs] will be enriched with a pipeline which syncs the sources, builds these as MTA and deploys the result into a Cloud Foundry environment. The application contains a simple `nodejs` application. Deployed as web service, it serves static data.
|
||||
|
||||
**Recommendation:** We recommend to clone the sample application [cloud-cf-helloworld-nodejs][cloud-cf-helloworld-nodejs] and execute the instructions on your own repository. See **(Optional) Sample Application**.
|
||||
**Recommendation:** We recommend to clone the sample application [cloud-cf-helloworld-nodejs][cloud-cf-helloworld-nodejs] and execute the instructions on your own repository. See **(Optional) Sample Application**.
|
||||
|
||||
The stated instructions assume the use of this application.
|
||||
|
||||
@ -12,7 +12,7 @@ The stated instructions assume the use of this application.
|
||||
|
||||
* You have installed a Linux system with at least 4 GB memory. **Note:** We have tested our samples on Ubuntu 16.04. On Microsoft Windows, you might face some issues.
|
||||
* You have installed the newest version of Docker. See [Docker Community Edition](https://docs.docker.com/install/). **Note:** we have tested on Docker 18.09.6.
|
||||
* You have installed Jenkins 2.60.3 or higher. **Recommendation:** We recommend to use the `cx-server` toolkit. See **(Optional) Install the `cx-server` Toolkit for Jenkins**. **Note:** If you use your **own Jenkins installation** you need to care for "Piper" specific configuration. Follow [my own Jenkins installation][guidedtour-my-own-jenkins].
|
||||
* You have installed Jenkins 2.60.3 or higher. **Recommendation:** We recommend to use the `cx-server` toolkit. See **(Optional) Install the `cx-server` Toolkit for Jenkins**. **Note:** If you use your **own Jenkins installation** you need to care for "Piper" specific configuration. Follow [my own Jenkins installation][guidedtour-my-own-jenkins].
|
||||
* Your system has access to [GitHub.com][github].
|
||||
|
||||
## (Optional) Install the `cx-server` Toolkit for Jenkins
|
||||
@ -27,19 +27,17 @@ docker run -it --rm -u $(id -u):$(id -g) -v "${PWD}":/cx-server/mount/ ppiper/cx
|
||||
|
||||
When the files are downloaded into the current directory, launch the Jenkins server by using the following command:
|
||||
|
||||
|
||||
```sh
|
||||
./cx-server start
|
||||
```
|
||||
|
||||
For more information on the Jenkins lifecycle management and how to customize your Jenkins, have a look at the [Operations Guide for Cx Server][devops-docker-images-cxs-guide].
|
||||
|
||||
|
||||
## (Optional) Sample Application
|
||||
|
||||
Copy the sources of the application into your own Git repository. While we will ask you to fork the application's repository into a public GitHub space, you can use any version control system based on Git. **Note:** A public GitHub repository is visible to the public. The configuration files may contain data you don't want to expose.
|
||||
|
||||
1. Create an organization on GitHub, if you haven't any yet. See [Creating a new organization][github-create-org].
|
||||
1. Create an organization on GitHub, if you haven't any yet. See [Creating a new organization][github-create-org].
|
||||
1. Fork the repository [cloud-cf-helloworld-nodejs][cloud-cf-helloworld-nodejs] into your GitHub organization. See [Fork a repo][github-fork-repo]
|
||||
1. Get an account and space in the Cloud Foundry environment. For the deployment of the application you need access to a space on the Cloud Foundry environment of the SAP Cloud Platform. If you haven't any yet, get a [Trial Account][sap-cp-trial].
|
||||
1. Select the `1_REST_persist_in_Memory` branch of your [cloud-cf-helloworld-nodejs] fork. Other branches might work as well, but this one is tested.
|
||||
@ -58,7 +56,7 @@ Copy the sources of the application into your own Git repository. While we will
|
||||
}
|
||||
```
|
||||
The "prepare" step synchronizes the repository and initializes the project specific settings. For more information about Jenkinsfiles and pipelines, see [Using a Jenkinsfile][jenkins-io-jenkinsfile].
|
||||
|
||||
|
||||
1. Save your changes to your remote repository.
|
||||
|
||||
1. To set up a Jenkins job for your repository, open the Jenkins UI under `http://<jenkins-server-address>:<http-port>` and choose **New Item**. Per default, the `cx-server` starts Jenkins on HTTP port `80`. For more information, see the [Jenkins User Documentation][jenkins-io-documentation].
|
||||
@ -69,7 +67,7 @@ Copy the sources of the application into your own Git repository. While we will
|
||||
1. Provide a name for your new item (for example, *My First Pipeline*) and select **Pipeline**.
|
||||
<p align="center">
|
||||
![Create Pipeline Job](images/JenkinsNewItemPipeline-1.png "Jenkins New Item")
|
||||
</p>
|
||||
</p>
|
||||
|
||||
1. For **Definition** in the **Pipeline** options, choose **Pipeline script from SCM**.
|
||||
|
||||
@ -84,7 +82,7 @@ Copy the sources of the application into your own Git repository. While we will
|
||||
|
||||
1. Choose **Save**.
|
||||
|
||||
1. To run your pipeline, choose **Build Now** in the job UI. **Result:** The pipeline processed the single stage "prepare".
|
||||
1. To run your pipeline, choose **Build Now** in the job UI. **Result:** The pipeline processed the single stage "prepare".
|
||||
|
||||
|
||||
## Add a Build Step
|
||||
@ -121,7 +119,7 @@ Copy the sources of the application into your own Git repository. While we will
|
||||
|
||||
1. Save your changes to your remote repository.
|
||||
|
||||
1. To run your pipeline, choose **Build Now** in the job UI. **Result:** The pipeline processed two stages, the "prepare" and the "build".
|
||||
1. To run your pipeline, choose **Build Now** in the job UI. **Result:** The pipeline processed two stages, the "prepare" and the "build".
|
||||
|
||||
## Add a Deploy Step
|
||||
|
||||
@ -148,35 +146,33 @@ Copy the sources of the application into your own Git repository. While we will
|
||||
<p align="center">
|
||||
![Add Credentials](images/JenkinsCredentials-1.png "Add Credentials")
|
||||
</p>
|
||||
|
||||
|
||||
1. Save the Credential
|
||||
|
||||
1. Save your changes to your remote repository.
|
||||
|
||||
1. To run your pipeline, choose **Build Now** in the job UI. **Result:** The pipeline processed the three stages "prepare", "build" and "deploy".
|
||||
1. To run your pipeline, choose **Build Now** in the job UI. **Result:** The pipeline processed the three stages "prepare", "build" and "deploy".
|
||||
<p align="center">
|
||||
![Build Now](images/JenkinsPipelineJob.png "Stage View")
|
||||
</p>
|
||||
|
||||
If your pipeline fails, compare its files to the final [Jenkinsfile][guidedtour-sample.jenkins], the [config.yml][guidedtour-sample.config], and the [mta.yaml][guidedtour-sample.mta]. **Note**: YAML files are surprisingly sensitive regarding indentation.
|
||||
|
||||
If your pipeline fails, compare its files to the final [Jenkinsfile][guidedtour-sample.jenkins], the [config.yml][guidedtour-sample.config], and the [mta.yaml][guidedtour-sample.mta]. **Note**: YAML files are surprisingly sensitive regarding indentation.
|
||||
|
||||
## Open Application
|
||||
|
||||
Your application has been deployed into your space in the Cloud Foundry space on SAP Cloud Platform. Login to SAP Cloud Platform and navigate into you space. **Result:** Your space contains the application `piper.node.hello.world`, the state of the application is `Started`.
|
||||
<p align="center">
|
||||
![Deployed Application](images/SCPDeployApp-1.png "SAP Cloud Platform")
|
||||
</p>
|
||||
|
||||
</p>
|
||||
|
||||
Open the application name to get into the `Application Overview`. Open the **Application Route** and add `/users` to the URL. **Result:** The application returns a list of user data.
|
||||
|
||||
## What's Next
|
||||
|
||||
You are now familiar with the basics of using project "Piper". Through the concept of pipeline as code, project "Piper" and Jenkins pipelines are extremely powerful. While Jenkins pipelines offer a full set of common programming features, project "Piper" adds SAP-specific flavors. Have a look at the different **Scenarios** to understand how to easily integrate SAP systems with default pipelines. Browse the steadily increasing list of features you can implement through the project "Piper" **Steps**.
|
||||
You are now familiar with the basics of using project "Piper". Through the concept of pipeline as code, project "Piper" and Jenkins pipelines are extremely powerful. While Jenkins pipelines offer a full set of common programming features, project "Piper" adds SAP-specific flavors. Have a look at the different **Scenarios** to understand how to easily integrate SAP systems with default pipelines. Browse the steadily increasing list of features you can implement through the project "Piper" **Steps**.
|
||||
|
||||
The **Configuration** pattern supports simple pipelines that can be reused by multiple applications. To understand the principles of inheritance and customization, have a look at the the [configuration][resources-configuration] documentation.
|
||||
|
||||
|
||||
[guidedtour-my-own-jenkins]: myownjenkins.md
|
||||
[guidedtour-sample.config]: samples/cloud-cf-helloworld-nodejs/.pipeline/config.yml
|
||||
[guidedtour-sample.jenkins]: samples/cloud-cf-helloworld-nodejs/Jenkinsfile
|
||||
|
@ -7,4 +7,4 @@ provider: SAP Sample generator
|
||||
modules:
|
||||
- name: piper.node.hello.world
|
||||
type: nodejs
|
||||
path: .
|
||||
path: .
|
||||
|
Loading…
x
Reference in New Issue
Block a user