A pipeline for running tests against an OpenShift cluster.
-
A persistent Jenkins instance with a volume capacity of 50Gi.
-
A pipeline to build, test and push a custom Jenkins slave based off of the image jenkins-slave-base-rhel7:latest.
-
An OpenShift test pipeline which uses a Jenkinsfile to run tests against an OpenShift cluster.
-
The OKD/OC CLI and be logged into an OpenShift cluster with appropriate permissions
-
Python 3.7
-
Install the requirements for the Python CLI using the following command:
pip install -r requirements.txt
-
Fill out the
credentials.yaml
file with the required fields in base64 format for the test-pipeline.- This file is used to pass environment variables to Jenkins in order to run tests on the OpenShift cluster.
-
Use run.py to setup the pipeline using the following command:
# Use setup_pipeline first. # You can also supply no parameters to use all the defaults. # To specify specific parameters. Prefix with --<parametername>=<parametervalue> python run.py setup_pipeline [name] [source_repository_url] [source_repository_ref] [context_dir] [pipeline_context_dir] [project]
-
Use run.py to run the pipeline using the following command:
python run.py run_pipeline [credentials_path] [webhook_url] [secret] # Example: python run.py run_pipeline credentials.yaml https://ocp.somedomain.com:8443/apis/build.openshift.io/v1/namespaces/test-pipeline/buildconfigs/openshift-test-pipeline/webhooks/<secret>/generic b1c65552-c8e2-4620-b2fd-8ba84f3e8dd2
-
Login to Jenkins via the route exposed by OpenShift
-
On the left menu, click Manage Jenkins
-
Scroll down and click Configure System
-
Scroll down to the heading Slack
-
Set the workspace field to the desired Slack workspace
-
Click Add next to the credential field
-
Click Jenkins
-
Click the Kind dropdown menu, and click Secret text
-
Supply the Slack token in the secret field
-
Provide the ID
slack-token
-
Click Add
-
Select the
slack-token
from the Credential dropdown menu -
Set the Default channel / member id to the channel you wish to send notifications to
-
To see if notifications are working, click Test Connection
-
Once you have verified everything is working, click Save