Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TKNECO-90] Document How to Setup the Catalog #47

Merged
merged 3 commits into from
Oct 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,78 @@ Triggers, and any other element that can be used with `tektoncd/pipeline`).
- Possibly driving API "feature"/changes
Because we will write a lot of task, use them, … we should be able to find gap or
enhancements in the API, and propose them as TEPs (with data).

# Usage Examples


This section explains how to use the tasks supported in this repository with the help of various tools like Tekton Resolvers as well as Pipelines as Code.
Aneesh-M-Bhat marked this conversation as resolved.
Show resolved Hide resolved

## Using Tekton Resolvers
Aneesh-M-Bhat marked this conversation as resolved.
Show resolved Hide resolved

Make sure kubectl is installed, if not install it using this [link](https://kubernetes.io/docs/tasks/tools/).

After that create a YAML file as follows:

```yaml
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: simple-taskrun-example
spec:
workspaces:
- name: source
persistentVolumeClaim:
claimName: your-claim-name
subPath: source
taskRef:
resolver: git
params:
- name: url
value: https://github.com/openshift-pipelines/tektoncd-catalog.git
- name: revision
value: p
- name: pathInRepo
value: experimental/tasks/go-crane-image/v0.1.0/go-crane-image.yaml
params:
- name: app
value: example-task
- name: image
value:
prefix: "add-custom-prefix"
```

Filename used in example is taskrun.yaml

Note that for this example we have used a PersistentVolumeClaim as follows:

```yaml
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
name: test
name: test
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 250Mi
```

Filename used in example is pvc.yaml

Then use the following commands to apply & run the above TaskRun

- Create PVC resource: kubectl apply -f pvc.yaml
- Create TaskRun: kubectl apply -f taskrun.yaml

Similarly you use Resolvers to create Pipelines & PipelineRuns as well.

To learn more about resolver, use this [link](https://tekton.dev/docs/pipelines/resolution-getting-started/).

## Using Pipelines as Code

WIP