Browse Source

improve doc

pull/2/head
Nicolas Massé 9 years ago
parent
commit
a0d06ec8c3
  1. 19
      doc/CONFIGURE_JENKINS.md
  2. 17
      doc/INSTALL.md

19
doc/CONFIGURE_JENKINS.md

@ -1,8 +1,8 @@
# Configure Jenkins # Configure Jenkins
## Create a Credentials named `npm-secret` ## Create a credential named `npm-secret`
Login to Jenkins with your OpenShift credentials and create a Jenkins Credentials with the following parameters : Login to Jenkins with your OpenShift credentials and create a Jenkins credential with the following parameters :
- Scope: global - Scope: global
- Kind: Username with password - Kind: Username with password
- Username: \<your NPM username\> - Username: \<your NPM username\>
@ -40,19 +40,20 @@ Note: to update a plugin, select the `Updates` tab instead of the `Available` ta
## Create the Jenkins Pipeline ## Create the Jenkins Pipeline
Depending if you created a JenkinsPipeline BuildConfig, OpenShift may have created Depending if you created a JenkinsPipeline BuildConfig, OpenShift may have created
a Jenkins pipeline for you. In such a case, the Jenkins Pipeline is named `\<namespace\>/\<buildconfig-name\>`. a Jenkins pipeline for you. In such a case, the Jenkins Pipeline is named `<namespace>/<buildconfig-name>`.
So, if you installed the demo : So, if you installed the demo :
- manually, you need to create the pipeline from scratch - manually, you need to create the pipeline from scratch
- automatically, you need to update the pipeline to add the following parameters - automatically, you need to update the pipeline to add the following parameters
Note: As of today, OpenShift does not accept build environment variables with Jenkins pipelines. __Note :__ As of today, OpenShift does not accept build environment variables with Jenkins pipelines.
So you have to update the Jenkins pipeline created by OpenShift to add those variable. So you have to update the Jenkins pipeline created by OpenShift to add those variable.
In the next version this may change as there is a pull request for this feature In the next version this may change as there is a pull request for this feature
(see [\#11293](https://github.com/openshift/origin/issues/11293) (see [\#11293](https://github.com/openshift/origin/issues/11293)
and [\#12323](https://github.com/openshift/origin/pull/12323)). and [\#12323](https://github.com/openshift/origin/pull/12323)).
So, create or update a Jenkins Pipeline that accepts the following parameters : So, create a Jenkins Pipeline that accepts the following parameters or update
the existing Jenkins Pipeline so that it accepts the following parameters :
| Parameter Name | Parameter Type | Default Value | Description | | Parameter Name | Parameter Type | Default Value | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
@ -68,8 +69,8 @@ So, create or update a Jenkins Pipeline that accepts the following parameters :
| OPENSHIFT_PROD_ENVIRONMENT | String | demo-prod | The OpenShift project in which we will deploy the prod version | | OPENSHIFT_PROD_ENVIRONMENT | String | demo-prod | The OpenShift project in which we will deploy the prod version |
| OPENSHIFT_TEST_URL | String | http://demo.test.app.openshift.test | The App URL in the test environment (to run the integration tests) | | OPENSHIFT_TEST_URL | String | http://demo.test.app.openshift.test | The App URL in the test environment (to run the integration tests) |
Pick the pipeline from GIT using the option "Pipeline script from SCM" and the following parameters : Pick the pipeline from GIT using the option `Pipeline script from SCM` and the following parameters :
- SCM: GIT - SCM: `GIT`
- Script Path: Jenkinsfile - Script Path: `Jenkinsfile`
- Repository URL: https://github.com/nmasse-itix/OpenShift-Demo-NodeJS.git - Repository URL: https://github.com/nmasse-itix/OpenShift-Demo-NodeJS.git
- Branch Specifier: */master - Branch Specifier: `*/master`

17
doc/INSTALL.md

@ -1,4 +1,9 @@
# Full CICD Setup # Full CI/CD Setup
This section describe how to setup a complete CI/CD environment using Jenkins.
You can either setup the environment :
- in a fully automated way, using OpenShift templates
- manually
## Automated setup through Templates ## Automated setup through Templates
@ -10,7 +15,7 @@ oc new-project demo-test
oc new-project demo-prod oc new-project demo-prod
``` ```
Deploy a Jenkins in the build project : Deploy a Jenkins in the BUILD project :
``` ```
oc new-app -n demo-build --template=jenkins-persistent --name=jenkins -p MEMORY_LIMIT=1Gi oc new-app -n demo-build --template=jenkins-persistent --name=jenkins -p MEMORY_LIMIT=1Gi
``` ```
@ -46,7 +51,7 @@ oc new-project demo-test
oc new-project demo-prod oc new-project demo-prod
``` ```
Create the build config in the build environment : Create the build config in the BUILD environment :
``` ```
oc new-build -n demo-build nodejs~https://github.com/nmasse-itix/OpenShift-Demo-NodeJS.git --strategy=source --name=openshift-demo-nodejs oc new-build -n demo-build nodejs~https://github.com/nmasse-itix/OpenShift-Demo-NodeJS.git --strategy=source --name=openshift-demo-nodejs
``` ```
@ -67,12 +72,6 @@ oc adm policy add-role-to-user admin system:serviceaccount:demo-build:jenkins -n
oc adm policy add-role-to-user admin system:serviceaccount:demo-build:jenkins -n demo-prod oc adm policy add-role-to-user admin system:serviceaccount:demo-build:jenkins -n demo-prod
``` ```
Give rights on other environments to pull images from build environment :
```
oc adm policy add-role-to-group system:image-puller system:serviceaccounts:demo-test -n demo-build
oc adm policy add-role-to-group system:image-puller system:serviceaccounts:demo-prod -n demo-build
```
Tag the test image : Tag the test image :
``` ```
oc tag demo-build/openshift-demo-nodejs:latest openshift-demo-nodejs:ready-for-testing -n demo-test oc tag demo-build/openshift-demo-nodejs:latest openshift-demo-nodejs:ready-for-testing -n demo-test

Loading…
Cancel
Save