Questions tagged [jcasc]

Jenkins Configuration as Code (a.k.a. JCasC) Plugin. A way to configure Jenkins based on human-readable declarative configuration files.

You should use the tag for questions related to the Configuration as Code plugin.

42 questions
1
vote
1 answer

Adding certificate to Jenkins configuation as code

I am configuring an installation of Jenkins through JCasC. One of the plugins we're using is Kubernetes. In order to configure, it needs a server certificate to communicate with the k8s cluster. This is how that part of the config looks like:…
Passero
  • 222
  • 1
  • 10
1
vote
2 answers

Pass Variable on a Per-File Basis in Jenkins Configuration as Code Job DSL

https://github.com/jenkinsci/job-dsl-plugin/wiki/JCasC provides the following example of a separate groovy file referenced in the Jenkins Configuration as Code (CasC) syntax. jobs: - providedEnv: SUPERHERO: 'Midnighter' - file:…
Jamie Jackson
  • 1,158
  • 3
  • 19
  • 34
0
votes
0 answers

Jenkins Kubernetes - How to run commands on agents when they start?

I'm running Jenkins Configuration as code using Kubernetes I'm trying to find a way to run commands right after the pod starts. I have tried adding the commands using CMD/RUN using && and it didn't work. I have tried to change the ENTRYPOINT of the…
EilonA
  • 361
  • 5
  • 17
0
votes
0 answers

ERROR: Failed to clean the workspace - Jenkins workspace cleanup permissions issue

In Jenkins in K8S pod I'm using checkout in my scripted pipeline (The job is running in root permission) - checkout([$class : 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions …
EilonA
  • 361
  • 5
  • 17
0
votes
0 answers

Reading JCasC bitbucket repoOwner and repository from a Jenkinsfile

For reasons that are beyond my control, I need a Jenkinsfile that can be used in 2 jobs without modification. Each will need to know it's repoOwner & repository for using the correct location to store it's reports in a bucket. At present these…
user3130010
  • 93
  • 10
0
votes
2 answers

Jenkins Kubernetes (JCASC) How to set default container to my container instead of JNLP?

I'm using pipelines in Jenkins that are running using JNLP container instead of my container. I'm using Jenkins as a code (Jenkin Helm chart) If I add this block to the pipeline - container('my container') { } It is using 'my container'. How do I…
EilonA
  • 361
  • 5
  • 17
0
votes
0 answers

Jenkins Kubernetes - SSL issues PKIXCertPathValidator when trying to run jobs on slave pods

For some reason, when I try to test my kubernetes plugin connection, I get this error when using my image. It worked before, and now it doesn't. I'm not sure what caused it, did anyone see this error before? Logs…
EilonA
  • 361
  • 5
  • 17
0
votes
0 answers

Jenkins - scriptler scripts require admin approval, how to auto-approve scripts?

I have scripts in Scriptler plugin that require approval from administrator. I'm running Jenkins in K8S and I'm adding scripts into /var/jenkins_home/scriptler/scripts. How do I auto approve new scripts or disable the request to approve? Things I…
EilonA
  • 361
  • 5
  • 17
0
votes
0 answers

Jenkins - scriptler plugin access denied to scriptler git repo

After installing scriptler plugin I want to have my scripts saved in a source repo. I am trying to clone the default repo of scriptler -https://jenkins.xxxxxxxxxx.com/scriptler.git/ fatal: unable to access…
EilonA
  • 361
  • 5
  • 17
0
votes
0 answers

Jenkins Allow podTemplate to have YAML spec - JCASC and Kubernetes plugin

I'm using Jenkins configuration as code (JCASC). I'm having a pod template and I want to add NodeSelector + Tolerations. podTemplate doesn't support key of tolerations and NodeSelector so I need to add pod YAML spec... agent: enabled:…
EilonA
  • 361
  • 5
  • 17
0
votes
1 answer

Build Jenkins using Jenkins as code configuration and configure jobs in the code instead of the UI

I am using Jcasc (Jenkins as a code) and when I build Jenkins from scratch, the Jenkins is up without any jobs/folders exist. I want to have jobs predefined or organization folders (From github) predefined when I build the code. I have tried adding…
EilonA
  • 361
  • 5
  • 17
0
votes
1 answer

Running Jenkins jobs using Kubernetes plugin run by DEFAULT on JNLP container instead of my container

as documented here, by default, commands in Jenkins agents will run in the jnlp container. And yes, when I run my jenkins pipeline using this code, it will run on my main container - node('node-agent'){ container('main'){ sh "ls -la" } } I…
EilonA
  • 361
  • 5
  • 17
0
votes
0 answers

How can i migrate my jenkins plugins to a new jenkins instance using JCasC?

I have a Jenkins instance with lots of plugins installed and I want to migrate them to a new jenkins instance. (both running on centos, aws) Can I do this with JCasC? If so how? If not, what is the alternative way? I want to be able to bootstrap the…
TheWalkingMalteser
  • 561
  • 1
  • 9
  • 25
0
votes
0 answers

Jenkins Helm Chart - cannot update CASC_JENKINS_CONFIG environment variable

I'm installing Jenkins via their helm charts. I have a values file set up, and also have some JCasC yaml. I wanted to split up the JCasC into multiple files as the contents of the JCasC bloated the values file too much. I was able to split off…
user3334871
  • 1,251
  • 2
  • 14
  • 36
0
votes
0 answers

java.lang.NullPointerException: Cannot get property 'controller' on null object

I am using the Jenkins-as-a-Configuration tool to launch my Jenkins server but when I port-forward to my local host on port 8080 and try accessing the server, I am greeted with the error java.lang.NullPointerException: Cannot get property…
ddd
  • 17
  • 4