---
# Source: jenkins/templates/config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: something-jenkins
  namespace: default
  labels:
    "app.kubernetes.io/name": 'jenkins'
    "helm.sh/chart": "jenkins-2.0.0"
    "app.kubernetes.io/managed-by": "Helm"
    "app.kubernetes.io/instance": "something"
    "app.kubernetes.io/component": "jenkins-master"
data:
  apply_config.sh: |-
    mkdir -p /usr/share/jenkins/ref/secrets/;
    # Prevent Setup Wizard when JCasC is enabled
    echo $JENKINS_VERSION > /var/jenkins_home/jenkins.install.UpgradeWizard.state
    echo $JENKINS_VERSION > /var/jenkins_home/jenkins.install.InstallUtil.lastExecVersion
    # Install missing plugins
    cp /var/jenkins_config/plugins.txt /var/jenkins_home;
    rm -rf /usr/share/jenkins/ref/plugins/*.lock
    /usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
    # Copy plugins to shared volume
    yes n | cp -i /usr/share/jenkins/ref/plugins/* /var/jenkins_plugins/;
  plugins.txt: |-
    kubernetes:1.25.7
    workflow-job:2.39
    workflow-aggregator:2.6
    credentials-binding:1.22
    git:4.2.2
    configuration-as-code:1.41
