Name: pipeline
Owner: Rancher
Description: null
Created: 2017-06-09 16:28:26.0
Updated: 2018-05-23 12:54:01.0
Pushed: 2018-01-11 03:46:36.0
Homepage: null
Size: 9206
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
In this guide, you'll learn how to deploy the Rancher Pipeline service and create a pipeline for a simple nodeJS service as an example.
A Rancher environment — To run Rancher Pipeline, we recommend more than two cores and 4GB memory for each host.
A GitHub account — Fork a repository from this pipeline-example repository.
Rancher Pipeline is available in the community-catalog.
When all services in the Pipeline stack are in an Active
state, click Pipeline to access Pipeline UI.
Before adding a pipeline, first we need to configure source code management authentication. We will use Github OAuth for authentication in this Quick Start Guide.
In the top-right corner of the Pipeline UI, click the gear icon. The Settings page displays.
In the Git Authentication section, follow the instructions to complete the authentication. Once complete, your GitHub username displays in the Authenticated Users section.
Now we're going to add a pipeline and set up a source code management stage, a test stage to run a 'mock' test and build CI jobs, and a package stage for it.
test_stage
and click Add.test_stage
.nodeserver
. We'll use this name in the next section.node:8
. We're using this Docker image to run our server container.start
Next, we need to add another step in test_stage
to test our server.
test_stage
.node:8
.install
test
SERVER
. For Value, type nodeserver
. The testing code requires you to set the environment variable SERVER
as the server address it will test against.Lastly, we need to package our newly created server to a Docker image.
package_stage
.package_stage
.build
. We're going to build and push an image.<your dockerhub-id>/pipeline-helloword:latest
.Note: If you haven't registered in the Rancher Registry setting, a notification for registry authentication displays. Before proceeding to the next step, follow the instructions to complete the authentication. Then, double-click Push to refresh and confirm that your registry is ready.
Now we've set up a source code management stage, a test stage, and a package stage for the pipeline. Give a name to the pipeline, such as hello-world
, and then click Save. Your hello-world
pipeline displays in the list on the Pipeline page.
To manually run the pipeline, from the pipeline actions drop-down list on the right, click run.
By default, we've also registered a Webhook in GitHub. When you push to the GitHub repository, it will trigger a run of the associated pipeline. This Webhook only works if your Rancher Server is accessible from GitHub.
If you wanna make and test Rancher Pipeline yourself, just follow steps below.
make
under your cloned directory.There are two options you can select to set up the test environment.
Upgrade every service under pipeline
stack to the image you built.
Fork community-catalog to your GitHub account.
Under your forked repository from step 1, modify images used in infra-templates/pipeline/<-version->/docker-compose.yml.tpl
to the images you built.
Add this forked repository as a Catalog in your Rancher Environment.
Deploy Rancher Pipeline in the Catalog of Step 3
Copyright (c) 2014-2017 Rancher Labs, Inc.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Please refer to Reference Guide for more information.