-
Notifications
You must be signed in to change notification settings - Fork 120
Jenkins Remote Execution Custom Task #697
Description
Opening this issue to collect ideas, discussion, interest, etc., for a custom task controller that executes a Jenkins Job on a remote Jenkins installation, watches it to completion, and reports success/failure, and maybe emits some results.
This would be the reverse of Vibhav's Jenkins Plugin for Tekton, which starts and watches Tekton executions from Jenkinsland. This new controller would let Jenkins users slowly adopt Tekton, either by having their Jenkins workloads kick off Tekton workloads, or now, vice versa. Or perhaps both, horrifyingly. 😨
This custom task could define a new CRD type that defines the Jenkins Job to create, possibly with parameters (and workspaces? Maybe?), and define them in the pipeline spec:
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
...
spec:
tasks:
- name: my-jenkins-job
taskRef:
apiVersion: example.dev/v0
kind: JenkinsJob
name: my-jenkins-job
When run, the custom task controller would look up a example.dev/v0 / JenkinsJob custom resource object named my-jenkins-job, which might look like:
apiVersion: example.dev/v0
kind: JenkinsJob
metadata:
name: my-jenkins-job
spec:
job:
# something goes here, I don't know what exactly
...then send that config to a remote Jenkins installation using the Remote Access API. After submitting, the controller would update the Run with any information about the Job it created, and proceed to poll the Job by repeatedly calling EnqueueAfter like wait-task does, until the Job is complete (or timeout).
Now, the part where I plead for help: I have basically no experience with Jenkins, I've only read documentation, but this seems doable at least as far as I can tell. Input from someone with more experience here would be very useful.