Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.08 KB

automation.md

File metadata and controls

45 lines (28 loc) · 1.08 KB

automation

OpenShift automation by build servers.

CLI

Automation can be done using the OpenShfit CLI, short oc tool. See the official documentation.

More hints and tipps for the oc tool: oc-tool.md

independency

It is crucial to be independent between the jobs / builds.

configuration location

The default location for the oc configuration is $HOME/.kube/

When all jobs are executed with the same user, this will possibly effect other jobs.

Logging into a OpenShift cluster or changing the project will modify that configuration.

configure local oc configuration location

Define the oc configuration location to be inside the workspace.

The oc tool is based on the Kubernetes kubectl. This is the reason because that the environment variable name is KUBECONFIG.

Environment example:

export KUBECONFIG=$(pwd)/.kube

Jenkins pipeline example:

pipeline {
    environment {
        KUBECONFIG="${pwd()}/.kube"
    }
    ...
}