Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:28
    timblaktu commented #1554
  • 18:20
    timblaktu commented #1554
  • 18:20
    timblaktu commented #1554
  • 18:19
    timblaktu commented #1554
  • 18:18
    timblaktu closed #1554
  • 18:18
    timblaktu commented #1554
  • 18:12
    jetersen unlabeled #1554
  • 18:12
    jetersen labeled #1554
  • 18:12
    jetersen commented #1554
  • 18:11
    jetersen commented #1554
  • 18:10
    jetersen commented #1554
  • 18:09
    jetersen commented #1554
  • 17:57
    timblaktu edited #1554
  • 17:53
    timblaktu labeled #1554
  • 17:53
    timblaktu opened #1554
  • 09:41

    timja on master

    (docs) update README.md (#1553)… (compare)

  • 09:41
    timja closed #1553
  • 09:41
    timja labeled #1553
  • 09:32
    codecov[bot] commented #1553
  • 09:31
    codecov[bot] commented #1553
Tim Jacomb
@timja
They are system properties set with -D on startup not jcasc values
João Patrício
@ijpatricio_twitter
aaah got it!
since i start from docker-compose, do you see a way to do it?
im running now with
    environment:
      - JAVA_OPTS=-Djenkins.install.SetupWizard.adminInitialApiToken=true
i'll let you know
João Patrício
@ijpatricio_twitter
it did not work. it now goes to the initial setup wizard when going localhost:8080 (that i did not want)
and in the end, did not generate the file with token
nor did the user have a token in its tokenStore
now i've put in dockerfile:
ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false -Djenkins.install.SetupWizard.adminInitialApiToken=true
logically, they shouldn't be both?
semantically, just generates the api token if it runs the setup wizard ?
Tim Jacomb
@timja
Probably a string quoting issue, it can be a pain to get right, normally easier to run it on your machine for initial testing
João Patrício
@ijpatricio_twitter
ouch...
i'm on docker on my machine, it's really easy to restart from scratch...
but yeah, issuing the commands might turn the debug easier
Tim Jacomb
@timja
java -Djenkins.install.SetupWizard.adminInitialApiToken=true -jar jenkins.war
when on your machine
René Zubcevic
@zubcevic
I like this blog post from Digital Ocean about how to set up a docker image with the plugins you want and the configuation as code as needed: how-to-automate-jenkins-setup-with-docker-and-jenkins-configuration-as-code
halkeye
@halkeye:g4v.dev
[m]
Oh nice and it bakes in plugins to the image. that's def a good one
Tim Jacomb
@timja
it uses the deprecated plugins script unfortunately but everything else looks good
halkeye
@halkeye:g4v.dev
[m]
Is it deprecated as in there's a message saying to use the new one? Or deprecated as in there is a new solution that should be used instead?
Tim Jacomb
@timja
there's a deprecation message outputted
João Patrício
@ijpatricio_twitter
hey guys. i have jenkins running in docker, and it uses docker/dind (docker in docker) so that jenkins can also build images and execute containers
and i'm using Jcasc
thing is im trying to generate user api admin token from scratch, as i want to manage the instance via rest, for adding credetials, jobs, etc...
kind of forgetting the GUI....
i have done with success yesterday the api token from basicAuth + crumb.... to retrieve token.
have been tinkering with groovy, and groovy on init, and so on... but found very difficult to debug/see iterations...
wanted to write to a file on disk, had no access
let me know if you have some questions
i will try later today or tomorrow jenkins directly on metal/host machine, not on mine, but on a vm/vps (without docker, just java)
as you suggested @timja , and share the results, as now we should figure out if something needs adjustments
tmcmm
@tmcmm

Hi guys I have jenkins(version Jenkins 2.271) and jcasc (version 1.46) and when trying to click on Dashboard it stucks in a eternum loading and outputs the exception:

Dec 22, 2020 11:52:02 AM hudson.ExpressionFactory2$JexlExpression evaluate
WARNING: Caught exception evaluating: job.buildHealthReports in /. Reason: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.commons.jexl.util.PropertyExecutor.execute(PropertyExecutor.java:125)
        at org.apache.commons.jexl.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:314)

Then after a while it displays the dashboard view ...
Has anyone been through this?
Thanks

Łukasz Dywicki
@splatch
hey there, I am migrating couple of builds from gitlab ci to jenkins and would like to utilize two major features - casc and kubernetes executors (on GKE). So far I am stuck on casc part and defining jobs. I never used pipeline syntax (been clicking through jenkins ui 5 years ago) and need to create one for Maven. Two questions which arise now are:
1) Is there a way to export existing build xml definition to pipeline script?
2) Where is documentation on possible jobs element values for casc configuration?
I read about kubernetes and secrets so I have no concerns there (yet).
Łukasz Dywicki
@splatch
found (partial) answer myself. There is support for script, file and http uris when listing job definitions.
Boonchu
@boonchu
Hello folks! I am a Jenkins newbie. I notice from my Jenkins console that suggest me to change something with this, "Configuration as Code obsolete file format: 'kubernetes' is obsolete, please use 'azureKubernetes'". Do we have any guides or practices to deal with the message?
Tim Jacomb
@timja
i assume you have the azure container agents plugin installed ?
do you also use the kubernetes plugin?
Ziv Harpaz
@zharpaz
Hi! I am looking for a way to configure jobs workspace directory location using CaC and / or helm charts. Anyone can point me to how to do it?
Ziv Harpaz
@zharpaz
Hi @c4m4 thank you for your answer. I did not explain myself clearly. I am looking for a way to change the default workspace at the Jenkins master level, when it is constructed, so all jobs get this setting as the default.
Amit Rintzler
@AmitRintzler_twitter
Hi All, not familiar with this plugin yet but very like the idea behind it, is it possible to lunch the jenkins from scratch using predefined configuration? in this example : https://www.jenkins.io/projects/jcasc/ you need to download docker and only after lunching the jenkins, need manual step to point the jenkins config files. but in case i want to use it OOB ? i want to have some internal build and every time i want to change something in the jenkins , it will switch to the new version .
Tim Jacomb
@timja
@AmitRintzler_twitter if you name the file jenkins.yaml and put it in the JENKINS_HOME directory it will be automatically picked up I believe, otherwise check the docs and search for that file name
amitrintzler
@amitrintzler
tnx, trying this one now https://www.jenkins.io/doc/book/installing/kubernetes/ it use jenkinsAsCode as OOB by the documentation , do you know this one?
Tim Jacomb
@timja
yes it was written recently
Ziv Harpaz
@zharpaz
@timja Thank you for your answer. How can I use it with helm charts / JCasC?
Nagle Zhang
@NagleZhang

Hey there,
I'm trying to export configuration ,but found error below:

java.lang.SecurityException: Rejected dangerous permission: hudson.model.Hudson.UploadPlugins
        at org.jenkinsci.plugins.rolestrategy.permissions.PermissionHelper.fromStrings(PermissionHelper.java:80)

searched from google, but found no clue. do we have any way to resolve this problem?

linkback
@linkback
Hi All recently hitting issues when using the JCasC Jobs. here are error that Im facing:
Jan 05, 2021 7:01:17 AM javaposse.jobdsl.plugin.JenkinsJobManagement createOrUpdateConfig
INFO: createOrUpdateConfig for JOB1
Jan 05, 2021 7:01:17 AM jenkins.InitReactorRunner$1 onTaskFailed
SEVERE: Failed ConfigurationAsCode.init
java.lang.Error: java.lang.reflect.InvocationTargetException
    at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
    at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
    at jenkins.model.Jenkins$5.runTask(Jenkins.java:1083)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
    ... 8 more
Caused by: io.jenkins.plugins.casc.ConfiguratorException: jobs: error configuring 'jobs' with class io.jenkins.plugins.casc.support.jobdsl.SeedJobConfigurator configurator
    at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:626)
    at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:649)
    at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:545)
    at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:275)
    at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:267)
    ... 13 more
Caused by: io.jenkins.plugins.casc.ConfiguratorException: jobs: Failed to execute script with hash 1582477339
    at io.jenkins.plugins.casc.support.jobdsl.SeedJobConfigurator.configure(SeedJobConfigurator.java:73)
    at io.jenkins.plugins.casc.support.jobdsl.SeedJobConfigurator.configure(SeedJobConfigurator.java:33)
    at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$configureWith$6(ConfigurationAsCode.java:649)
    at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:620)
    ... 17 more
Caused by: java.lang.IllegalArgumentException: JOB1 already exists
    at hudson.model.Items.verifyItemDoesNotAlreadyExist(Items.java:641)
    at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:267)
    at jenkins.model.Jenkins.createProjectFromXML(Jenkins.java:3893)
....
Tim Jacomb
@timja

it says:

JOB1 already exists

4 replies
tudordabija
@tudordabija
i am trying to get jcasc setting up jenkins running in kubernetes. I need to setup 'jenkinsTunnel' ... this is {{ ClusterIP }}:{{50000}} that gets assigned to pod. Any working example on how to accomplish this?
1 reply
Tim Black
@timblaktu

Anyone ever see their systemMessage get copied into their job descriptions? I am. I've verified that the .groovy/jobdsl files that i have referened from the jobs: section in my ~jenkins/jenkins.yaml all have a distinct job description (e.g. job { description('myjob') }), but after reloading CasC and looking at the jobs in the GUI, they look like "<systemMessage>myjob". Perplexed. I even tried deleting the jobs through the GUI and reprovisioning them through CasC, but the job descriptions still have my systemMessage in them.

EDIT: Duh, I think what I'm seeing is just that the systemMessage appears on all pages, so on a job page, the systemMessage appears just above the job description. As designed. What is odd, however, is that this behavior isn't the case for ALL my jobs, just some, and I can't figure out what the difference is..

1 reply
fugkco
@fugkco
Anyone any thoughts how we can configure the priority sorter plugin through CASC?
Tim Black
@timblaktu
What sort of workflow do you use when troubleshooting syntax errors in groovy/JobDSL files loaded via CasC? Since these prevent Jenkins from booting, it seems cumbersome. My workflow is to edit JobDSL and CasC yaml locally, copy to Jenkins and trigger CasC reload via remote API.
10 replies