0

I am new to Tekton pipeline. I am migrating Jenkins file from Tekton pipeline

I do have the follow jenkinsfile codes

pipeline {
libraries {
lib 'operator-pipeline-library'
}
parameters {
string(name: 'OPERATOR_CATALOG_REPO', description: ' operator images that are in the catalog', defaultValue: 'operator-3rdparty-dev-local.net')
string(name: 'OPERATOR_INDEX', description: 'Artifactory ', defaultValue: 'operator-3rdparty-catalog-dev-local.net')
}
agent {
kubernetes {
cloud 'openshift'
yamlFile 'operator-mirror-pod.yaml'
}
}
}

I do want to know how do I re-write the following

agent {
kubernetes {
cloud 'openshift'
yamlFile 'operator-pod.yaml'
}
}

in Tekton pipelines

yedan
  • 1
  • What problem are you trying to solve? – Jonas Jan 28 '22 at 18:55
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Feb 05 '22 at 02:51

1 Answers1

0

When I want to do something with Tekton, the first thing I would recommend checking is the Tekton Catalog. They have a GitHub repository.

In your case, they have the openshift-client task that could be useful.

Depending on how your Jenkins was configured, you may have to reproduce its credentials configuration as Kubernetes Secrets - or executing commands against local cluster, make sure your PipelineRun uses a ServiceAccount with enough privileges to create objects.

As a more generic answer: how do I translate Jenkins groovy into Tekton: you don't. You rewrite everything from scratch. And while it may be the beginning of a long road: at the end of it, you're done with groovy. You can script in python, ruby, shell, whatever runtime you have in your pods. All of which would be better options, in terms of performance, maintenance, ...

SYN
  • 4,476
  • 1
  • 20
  • 22