Use resolver type hub
.
Param Name | Description | Example Value |
---|---|---|
catalog |
The catalog from where to pull the resource (Optional) | Default: Tekton |
kind |
Either task or pipeline |
task |
name |
The name of the task or pipeline to fetch from the hub | golang-build |
version |
Version of task or pipeline to pull in from hub. Wrap the number in quotes! | "0.5" |
See the getting started instructions in the Tekton Resolution repo.
- Install the Hub resolver:
$ ko apply -f ./config
By default this resolver will hit the public hub api at https://hub.tekton.dev/
but you can configure your own (for example to use a private hub
instance) by setting the HUB_API
environment variable in
config/hubresolver-deployment.yaml
. Example:
env
- name: HUB_API
value: "https://api.hub.tekton.dev/"
Try creating a ResolutionRequest
for a hub entry:
$ cat <<EOF > rrtest.yaml
apiVersion: resolution.tekton.dev/v1alpha1
kind: ResolutionRequest
metadata:
name: fetch-hub-entry
labels:
resolution.tekton.dev/type: hub
spec:
params:
kind: task
name: git-clone
version: "0.5"
kind: task
EOF
$ kubectl apply -f ./rrtest.yaml
$ kubectl get resolutionrequest -w fetch-hub-entry
You should shortly see the ResolutionRequest
succeed and the content of
the git-clone
yaml base64-encoded in the object's status.data
field.
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: hub-demo
spec:
pipelineRef:
resolver: hub
resource:
- name: catalog # optional
value: Tekton
- name: kind
value: pipeline
- name: name
value: buildpacks
- name: version
value: "0.1"
# Note: the buildpacks pipeline requires parameters.
# Resolution of the pipeline will succeed but the PipelineRun
# overall will not succeed without those parameters.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License.