49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
apiVersion: tekton.dev/v1
|
|
kind: Task
|
|
metadata:
|
|
name: openshift-ephemeral-namespace-client
|
|
namespace: goghvideo-cicd-pipeline
|
|
spec:
|
|
description: |-
|
|
This task runs commands against the cluster provided by user and if not provided then where the Task is being executed.
|
|
OpenShift is a Kubernetes distribution from Red Hat which provides oc, the OpenShift CLI that complements kubectl for simplifying deployment and configuration applications on OpenShift.
|
|
params:
|
|
- default: oc help
|
|
description: The OpenShift CLI arguments to run
|
|
name: SCRIPT
|
|
type: string
|
|
- default: "4.7"
|
|
description: The OpenShift Version to use
|
|
name: VERSION
|
|
type: string
|
|
results:
|
|
- name: namespace
|
|
type: string
|
|
description: The namespace which was created
|
|
- name: filedrop
|
|
type: string
|
|
description: The name of the filedrop for testing
|
|
steps:
|
|
- image: quay.io/openshift/origin-cli:$(params.VERSION)
|
|
name: oc
|
|
script: |
|
|
#!/usr/bin/env bash
|
|
|
|
[[ "$(workspaces.manifest-dir.bound)" == "true" ]] && \
|
|
cd $(workspaces.manifest-dir.path)
|
|
|
|
[[ "$(workspaces.kubeconfig-dir.bound)" == "true" ]] && \
|
|
[[ -f $(workspaces.kubeconfig-dir.path)/kubeconfig ]] && \
|
|
export KUBECONFIG=$(workspaces.kubeconfig-dir.path)/kubeconfig
|
|
|
|
$(params.SCRIPT)
|
|
workspaces:
|
|
- description: The workspace which contains kubernetes manifests which we want to
|
|
apply on the cluster.
|
|
name: manifest-dir
|
|
optional: true
|
|
- description: The workspace which contains the the kubeconfig file if in case we
|
|
want to run the oc command on another cluster.
|
|
name: kubeconfig-dir
|
|
optional: true
|