Setup predefined pipeline jobs in helm-jenkins

4/13/2020

Currently I am trying to setup predefined job in helm jenkins.

I have tried to modify templates/jobs.yaml configmap file but no luck. I also tried to modify values.yaml file

master:
  jobs:
    test : | 
     xm code 

but no luck.

Basically what I am trying to achieve is have following pipeline code as job.

pipeline {
  agent {
    kubernetes {
      yaml """
apiVersion: v1
kind: Pod
metadata:
  labels:
    some-label: some-label-value
spec:
  containers:
  - name: maven
    image: maven:alpine
    command:
    - cat
    tty: true
  - name: busybox
    image: busybox
    command:
    - cat
    tty: true
"""
    }
  }
  stages {
    stage('Run maven') {
      steps {
        container('maven') {
          sh 'mvn -version'
        }
        container('busybox') {
          sh '/bin/busybox'
        }
      }
    }
  }
}

When I do "helm install " job comes up. Any idea or direction are welcome.

-- pythonhmmm
jenkins-pipeline
kubernetes-helm

0 Answers