apiVersion: v1
kind: ConfigMap
metadata:
  name: jenkins-casc
  namespace: jenkins-project-akps
data:
  jenkins.yaml: |
    jenkins:
      systemMessage: "Reloading Configuration from Jenkins on the go - during the meeting"
      authorizationStrategy:
        roleBased:
          roles:
            global:
              - name: "admin"
                description: "Jenkins administrators"
                permissions:
                  - "Overall/Administer"
                assignments:
                  - "admin"
              - name: "readonly"
                description: "Read-only users"
                permissions:
                  - "Overall/Read"
                  - "Job/Read"
                assignments:
                  - "authenticated"
      securityRealm:
        local:
          allowsSignup: false
          users:
            - id: "admin"
              password: "admin123"
            - id: "user"
              password: "user123"
    jobs:
      - script: >
          pipelineJob('Jenkins Job Builder') {
            definition {
              triggers {
                scm('* * * * *')
              }
              cpsScm {
                scm {
                  git {
                    remote { url('https://github.com/anilkps199/jenkins-kubernetes.git') }
                    branches('master')
                    scriptPath('jenkins-job-builder/Jenkinsfile')
                  }
                }
              }
            }
          }
    unclassified:
      location:
        url: ${JENKINS_URL}
