func (t *Task) Deploy(clientset *client.ConfigSet) (*tekton.Task, error) {
	if !file.IsLocal(t.File) {
		clientset.Log.Debugf("cannot find %q locally, downloading", t.File)
		path, err := file.Download(t.File)
		if err != nil {
			return nil, fmt.Errorf("task not found: %s", err)
		}
		t.File = path
	}
	task, err := t.readYAML()
	if err != nil {
		return nil, err
	}
	for k, v := range task.Spec.Params {
		if v.Type == "" {
			task.Spec.Params[k].Type = tekton.ParamTypeString
		}
	}
	task.SetNamespace(t.Namespace)
	if t.GenerateName != "" {
		task.SetName("")
		task.SetGenerateName(t.GenerateName)
	} else if t.Name != "" {
		task.SetName(t.Name)
	}
	if clientset.Registry.Secret != "" {
		clientset.Log.Debugf("setting registry secret %q for task \"%s/%s\"", clientset.Registry.Secret, task.GetNamespace(), task.GetName())
		setupEnv(clientset, task)
		setupVolume(clientset, task)
	}
	if clientset.Registry.SkipTLS {
		clientset.Log.Debugf("setting '--skip-tls-verify' flag for task \"%s/%s\"", task.GetNamespace(), task.GetName())
		setupArgs(clientset, task)
	}
	if t.FromLocalSource {
		clientset.Log.Debugf("adding source uploading step to task \"%s/%s\"", task.GetNamespace(), task.GetGenerateName())
		task.Spec.Steps = append([]tekton.Step{t.customStep()}, task.Spec.Steps...)
		task.Spec.Resources = &tekton.TaskResources{}
	}
	if client.Dry {
		return task, nil
	}
	return t.CreateOrUpdate(task, clientset)
}
Deploy accepts path (local or URL) to tekton Task manifest and installs it
package task
import (
	"context"
	"fmt"
	"io/ioutil"
	"strings"
	"github.com/ghodss/yaml"
	tekton "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
	"github.com/triggermesh/tm/pkg/client"
	"github.com/triggermesh/tm/pkg/file"
	corev1 "k8s.io/api/core/v1"
	k8serrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
	kind              = "Task"
	api               = "tekton.dev/v1beta1"
	uploadDoneTrigger = ".uploadIsDone"
)