GitHub Action to install the OpenShift Client 'oc' into an action runner.
oc-installer
installs the OpenShift Client CLI oc
onto your GitHub Action runner.
Note that GitHub's Ubuntu Environments come with oc 4.6
installed. So, if you are using one of those environments and do not require a different oc
version, this action is not necessary for your workflow.
Once oc
is present, use oc-login to log into the cluster and set up a Kubernetes context.
This action has been superseded by openshift-tools-installer, which can install oc
as well as other CLIs. It has support for caching across multiple workflows, and allows inputting semantic version ranges.
This action can still be used, but points to an old download directory which is no longer updated as of December 2020.
The action has one input: oc_version
. If not specified, it defaults to latest
.
The oc_version
can be:
latest
(the default) to use the latest stable release.oc
version. For example, 4.6
or 3.11.173
.
oc
.Also see this repository's workflows.
steps:
- name: Install oc
uses: redhat-actions/oc-installer@v1
with:
oc_version: '4.6'
# Now, oc is available for the rest of these steps.
If you need a self-hosted runner to communicate via a proxy server, you can use one of the following methods as described in the GitHub Actions documentation.
.env
file to set the proxy configurationoc-installer caches the oc
executable to avoid downloading the same executable multiple times when running different jobs.
The cache is only enabled when the version
input is specified as a semantic version in the task. If the version is latest
, or a URL, the cache is not used.
The oc executable will be cached inside the _work/_tool/oc
folder.