Giter Site home page Giter Site logo

tetchel / openshift-cli-installer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redhat-actions/openshift-tools-installer

0.0 1.0 0.0 4.54 MB

WIP poly-installer for client executables served by mirror.openshift.com

License: MIT License

Shell 0.93% JavaScript 4.47% TypeScript 94.60%

openshift-cli-installer's Introduction

OpenShift CLI Installer Action

CI Checks Example Workflow

tag badge license badge

This is a GitHub Action that downloads and installs client CLIs from mirror.openshift.com, allowing you to easily use these tools in your Action workflows.

  • Supports all 3 major operating systems
  • Effective on a GitHub runner, or a self-hosted runner
  • Leverages the Actions cache so subsequent downloads are lightning fast
  • Semver support allows total version flexibility

Supported CLIs

CLI Name Directory Notes
crc crc crc is much larger than the other CLIs, at 2.5GB.
helm helm v3 only.
kamel camel-k
kn serverless
oc v3 and ocp oc v3 and v4 are served from different directories.
odo odo
openshift-installer ocp Not available for Windows.
opm opm Only available for Linux.
tkn pipeline

Inputs

The action inputs are just the names of the support CLIs, exactly as listed above. The value for each input is a semantic version or range for that CLI. If the version given is a range, this action will install the maximum version that satisfies the range.

The version can also be "*", or "latest", which are the same. This installs the latest production release that is available on the mirror.

For a list of available versions of a given CLI, follow the Directory links in the table above, and look at the versions available.

If an invalid version is specified, the action will not proceed with any installations.

If the requested version is valid but not available on the mirror, the action fails, but any CLIs that were found will still be installed and cached.

Example

Here is an workflow step demonstrating some common version inputs. Also see the example workflow.

Version numbers must be quoted so the yaml parser interprets them as strings.

Refer to the semver documentation. The action uses the semver package, so all syntax is supported.

steps:
  - name: Install CLIs
    uses: redhat-actions/openshift-cli-installer@v1
    with:
      # Installs the latest camel-k release.
      kamel: latest

      # Installs the latest release of oc with the major version 3.
      # This is equivalent to "3.x" or "^3".
      oc: "3"

      # Installs the latest release of odo with the major version 2, and the minor version 0.
      # This would install odo 2.0.3, but not odo 2.1.0.
      odo: "2.0"

      # This exact version will install version 0.11.0 of Tekton, no other version.
      tkn: "0.11.0"

Outputs

The action has one output called installed, which is a JSON object that maps CLI names (as above) to an object describing the version that was installed.

For example, after installing oc with the version range "4.3", the output object contains:

{
    // ... other CLIs omitted
    oc: {
        fromCache: true,
        installedPath: "/home/runner/work/openshift-cli-installer/openshift-cli-installer/openshift-bin/oc",
        url: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.3.40/openshift-client-linux-4.3.40.tar.gz",
        version: "4.3.40"
    }
}

If a CLI was not installed due to an error, it will be absent from this object. Check the action output and workflow summary for the error.

Caching

The executables are cached after being download and extracted. The cache key is determined by the CLI and the actual version that was downloaded - not the range that was input.

This means that if a new version is released that satisfies the version range, the cached old version will be bypassed in favour of the new version which is then cached. The upgrade is done for you, so long as the version range allows it.

See the actions/cache repository for cache limits.

openshift-cli-installer's People

Contributors

tetchel avatar gfvirga avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.