diff --git a/docs/task-openshift-client.md b/docs/task-openshift-client.md new file mode 100644 index 0000000..536e39d --- /dev/null +++ b/docs/task-openshift-client.md @@ -0,0 +1,57 @@ +`OpenShift-Cient` Tekton Task +----------------------- + +# Abstract + +The `openshift-client` Task is the binary for OpenShift CLI that complements kubectl for simplifying deployment and configuration applications on OpenShift. + +# Usage + +Please, consider the usage example below: + +```yaml +--- +apiVersion: tekton.dev/v1 +kind: PipelineRun +metadata: {} +spec: + pipelineRef: + name: task-openshift-client + params: + - name: SCRIPT + value: openShift-CLI-arguments + - name: VERSION + value: oc-version + +``` +You'll need to replace `openShift-CLI-arguments` with OpenShift CLI arguments that you want to run and replace `oc-version` with the version of OpenShift you want to use. +In case the Container Registry requires authentication, please consider the [Tekton Pipelines documentation][tektonPipelineAuth]. In a nutshell, you need to create a Kubernetes Secret describing the following attributes: + +```bash +kubectl create secret docker-registry imagestreams \ + --docker-server="image-registry.openshift-image-registry.svc:5000" \ + --docker-username="${REGISTRY_USERNAME}" \ + --docker-password="${REGISTRY_TOKEN}" +``` + +Then make sure the Secret is linked with the Service-Account running the `TaskRun`/`PipelineRun`. + +## Workspace + +| Name | Optional | Description | +| :------------ | :------------------------: | :--------------------------- | +| `manifest_dir` | `true` | The workspace which contains kubernetes manifests which we want to apply on the cluster. | +| `kubeconfig_dir` | `true` | The workspace which contains the the kubeconfig file if in case we want to run the oc command on another cluster. | + + +## Params + +| Param | Type | Default | Description | +| :------------ | :------------------------: | :--------------------------- | :------------------------- | +| `SCRIPT` | `string` | (required) | The OpenShift CLI arguments to run | +| `VERSION` | `string` | (required) | The OpenShift version to use | + + + +[tektonPipelineAuth]: https://tekton.dev/docs/pipelines/auth/#configuring-docker-authentication-for-docker + diff --git a/docs/task-tkn.md b/docs/task-tkn.md new file mode 100644 index 0000000..6b93ce4 --- /dev/null +++ b/docs/task-tkn.md @@ -0,0 +1,56 @@ +`Tkn` Tekton Task +----------------------- + +# Abstract + +The `tkn` Task is a binary to perform operations on Tekton resources using tkn. + +# Usage + +Please, consider the usage example below: + +```yaml +--- +apiVersion: tekton.dev/v1 +kind: PipelineRun +metadata: {} +spec: + pipelineRef: + name: task-tkn + params: + - name: SCRIPT + value: "tkn $@" + - name: ARGS + value: tkn-command-you-want-to-execute + +``` +You'll need to replace `tkn-command-you-want-to-execute` with tkn CLI arguments based on what operation you want to perform on the Tekton resources. +In case the Container Registry requires authentication, please consider the [Tekton Pipelines documentation][tektonPipelineAuth]. In a nutshell, you need to create a Kubernetes Secret describing the following attributes: + +```bash +kubectl create secret docker-registry imagestreams \ + --docker-server="image-registry.openshift-image-registry.svc:5000" \ + --docker-username="${REGISTRY_USERNAME}" \ + --docker-password="${REGISTRY_TOKEN}" +``` + +Then make sure the Secret is linked with the Service-Account running the `TaskRun`/`PipelineRun`. + +## Workspace + +| Name | Optional | Description | +| :------------ | :------------------------: | :--------------------------- | +| `kubeconfig_dir` | `true` | An optional workspace that allows you to provide a .kube/config file for tkn to access the cluster. | + + +## Params + +| Param | Type | Default | Description | +| :------------ | :------------------------: | :--------------------------- | :------------------------- | +| `SCRIPT` | `string` | (required) | tkn CLI script to execute | +| `ARGS` | `array` | (required) | tkn CLI arguments to run | + + + +[tektonPipelineAuth]: https://tekton.dev/docs/pipelines/auth/#configuring-docker-authentication-for-docker + diff --git a/test/e2e/resources/pipeline.yaml b/test/e2e/resources/pipeline.yaml index 3021300..f751e8d 100644 --- a/test/e2e/resources/pipeline.yaml +++ b/test/e2e/resources/pipeline.yaml @@ -1,5 +1,5 @@ --- -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Pipeline metadata: labels: diff --git a/test/e2e/resources/tkn-pipeline.yaml b/test/e2e/resources/tkn-pipeline.yaml index 9125dd9..65c140b 100644 --- a/test/e2e/resources/tkn-pipeline.yaml +++ b/test/e2e/resources/tkn-pipeline.yaml @@ -1,5 +1,5 @@ --- -apiVersion: tekton.dev/v1beta1 +apiVersion: tekton.dev/v1 kind: Pipeline metadata: labels: