jmickey / redhat-openshift-orb

A CircleCI Orb to simplify deployments to Red Hat OpenShift.

Home Page:http://circleci.com/orbs/registry/orb/circleci/redhat-openshift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Red Hat OpenShift Orb CircleCI status CircleCI Orb Version GitHub license CircleCI Community

A CircleCI Orb to simplify deployments to Red Hat OpenShift.

Here are some features that the Red Hat OpenShift orb provides:

  • Allowing kubectl and other tools that access kubeconfig (like helm) to connect to a local/remote Red Hat OpenShift cluster via the login-and-update-kubeconfig command
  • Creating of a local Red Hat OpenShift cluster via the create-local-cluster-with-oc command. This could be useful for tests.
  • Installing the Red Hat OpenShift client CLI (oc) via the install-openshift-cli command.

Usage

See the orb registry listing for usage guidelines.

Requirements

  • curl should be present in PATH.

Examples

Full usage examples can be found on the Red Hat OpenShift orb's page in the orb registry, here.

version: 2.1

orbs:
  redhat-openshift: circleci/redhat-openshift@0.1.0
  kubernetes: circleci/kubernetes@0.3.0

jobs:
  deploy-to-cluster:
    executor: redhat-openshift/default
    steps:
      - redhat-openshift/login-and-update-kubeconfig:
          # e.g. https://api.mycluster.myserver.org:6443
          server-address: $OPENSHIFT_SERVER
          username: $OPENSHIFT_USER
          password: $OPENSHIFT_PASSWORD
          # Enable this if the cluster uses a self-signed cert
          insecure-skip-tls-verify: true
          openshift-platform-version: "4.x"
      - run:
          name: Create example k8s deployment yaml file
          command: |
            cat \<<- EOF > deployment.yaml
            apiVersion: apps/v1
            kind: Deployment
            metadata:
              name: nginx-deployment
            spec:
              selector:
                matchLabels:
                  app: nginx
              replicas: 2
              template:
                metadata:
                  labels:
                    app: nginx
                spec:
                  containers:
                  - name: nginx
                    image: nginx:1.7.9
                    ports:
                    - containerPort: 80
            EOF
      - kubernetes/create-or-update-resource:
          resource-file-path: "deployment.yaml"
          resource-name: "deployment/nginx-deployment"
          get-rollout-status: true
workflows:
  deployment:
    jobs:
      - deploy-to-cluster

Contributing

We welcome issues to and pull requests against this repository!

For further questions/comments about this or other orbs, visit CircleCI's orbs discussion forum.

About

A CircleCI Orb to simplify deployments to Red Hat OpenShift.

http://circleci.com/orbs/registry/orb/circleci/redhat-openshift

License:MIT License