<commit_before>Jenkins Master->Slave Example
=============================
This sample walks through the process of starting up an OpenShift cluster and deploying a Jenkins Pod in it.
It also leverage the [kubernetes-plugin](https://wiki.jenkins-ci.org/display/JENKINS/Kubernetes+Plugin) to manage
the Jenkins slaves that run as on-demand Pods.

The sample job that this Jenkins example contains will execute an unit test for
a simple Ruby application. The unit test will be executed in a pod managed by
the kubernetes plugin.

Because the Jenkins Slave pod needs a Docker image that connects to Jenkins
when it starts, this sample also provides a template that allows you to convert
any OpenShift S2I image to a valid Jenkins Slave image.

This template is not required if you already have Docker image that has the
script that launches the [slave
agent](https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds#Distributedbuilds-Launchslaveagentheadlessly)
as an entrypoint. In that case, you have to create the image stream for this
image and set the image stream label `role` to `jenkins-slave`.

The [Jenkins image](https://github.com/openshift/jenkins) includes the
Kubernetes plugin, so it can manage slave pods by default. This tutorial
includes a template which further customizes the Jenkins image by adding the Git
plugin and define the sample job used by the tutorial.

Steps
------
1. Create new OpenShift project, where the Jenkins server will run:
```
$ oc new-project ci
```

2. Give the Jenkins Pod [service account](https://docs.openshift.org/latest/admin_guide/service_accounts.html)
   rights to do API calls to OpenShift.  This allows us to do the Jenkins Slave
   image discovery automatically.
```
$ oc policy add-role-to-user edit system:serviceaccount:ci:default -n ci
```

3. Install the provided OpenShift templates:
```
# Slave convertor (optional):
$ oc create -f https://goo.gl/YROngT

# Jenkins master template:
$ oc create -f https://goo.gl/HPXiOs
```

4. Now navigate to the OpenShift Web Console and switch to the `ci` project.

5. Click on *Add to project* a select the `s2i-to-jenkins-slave` template. Here
   you can customize the image stream name for the builder image or use
   alternative repository with your own custom entry point script.

6. Click *Create* and navigate to *Browse/Builds*. You should see the build
   running. Once this build finish, you should have the Jenkins Slave image
   ready to be used.<commit_msg>Minor fixes to Jenkins kubernetes readme<commit_after>Jenkins Master->Slave Example
=============================
This sample walks through the process of starting up an OpenShift cluster and deploying a Jenkins Pod in it.
It also leverage the [kubernetes-plugin](https://wiki.jenkins-ci.org/display/JENKINS/Kubernetes+Plugin) to manage
the Jenkins slaves that run as on-demand Pods.

The sample job that this Jenkins example contains will execute an unit test for
a simple Ruby application. The unit test will be executed in a pod managed by
the kubernetes plugin.

Because the Jenkins Slave pod needs a Docker image that connects to Jenkins
when it starts, this sample also provides a template that allows you to convert
any OpenShift S2I image to a valid Jenkins Slave image.

This template is not required if you already have Docker image that has the
script that launches the [slave
agent](https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds#Distributedbuilds-Launchslaveagentheadlessly)
as an entrypoint. In that case, you have to create the image stream for this
image and set the image stream label `role` to `jenkins-slave`.

The [Jenkins image](https://github.com/openshift/jenkins) includes the
Kubernetes plugin, so it can manage slave pods by default. This tutorial
includes a template which further customizes the Jenkins image by adding the Git
plugin and define the sample job used by the tutorial.

Steps
------
1. Create new OpenShift project, where the Jenkins server will run:
```
$ oc new-project ci
```

2. Give the Jenkins Pod [service account](https://docs.openshift.org/latest/admin_guide/service_accounts.html)
   rights to do API calls to OpenShift.  This allows us to do the Jenkins Slave
   image discovery automatically.
```
$ oc policy add-role-to-user edit system:serviceaccount:ci:default -n ci
```

3. Install the provided OpenShift templates:
```
# Slave convertor (optional):
$ oc create -f https://goo.gl/HPXiOs

# Jenkins master template:
$ oc create -f https://goo.gl/YROngT
```

4. Now navigate to the OpenShift Web Console and switch to the `ci` project.

5. Click on *Add to project* a select the `jenkins-slave-builder` template. Here
   you can customize the image stream name for the builder image or use
   alternative repository with your own custom entry point script.

6. Click *Create* and navigate to *Browse/Builds*. You should see the build
   running. Once this build finish, you should have the Jenkins Slave image
   ready to be used.
{'fraction_non_alphanumeric': 0.07700040209087254, 'fraction_numerical': 0.0030156815440289505, 'mean_word_length': 4.390032502708559, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5429071', 'n_tokens_mistral': 1370, 'n_tokens_neox': 1301, 'n_words': 672}