Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
KreativeKrise
@KreativeKrise

I started a new installation of Jenkins and now I just get this warning:

Sep 12, 2019 8:00:10 AM WARNING io.jenkins.plugins.casc.BaseConfigurator createAttribute

Can't handle class org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl#file: type is abstract but not Describable.

But the credential is still not working.

Mark Waite
@MarkEWaite
There had been suggestions that the configuration as code plugin efforts might want to move from working within the Cloud Native special interest group to working within the platform special interest group. The platform special interest group meets every two weeks for platform related projects and topics.
Meeting starts in about 20 minutes at https://zoom.us/j/848212302
Meeting agenda is at https://docs.google.com/document/d/1bDfUdtjpwoX0HO2PRnfqns_TROBOK8tmP6SgVhubr2Y/edit?usp=sharing
I'm not aware of any hot topics that configuration as code would need to discuss, just sharing notice...
Oleg Nenashev
@oleg-nenashev
@casz starting without you
Oleg Nenashev
@oleg-nenashev
Better late than never. Recording of the next yesterday;s meeting will be here: https://youtu.be/cTZuMOCbkPQ
Rodolfo Boer
@move-z
hi, i have some problems while trying to configure jenkins via this plugin, is this the right place to ask for help?
Daniel Estermann
@d.esterman_gitlab
@oleg-nenashev I'll attend to this
Joseph Petersen
@casz
@move-z yup
Oleg Nenashev
@oleg-nenashev
@d.esterman_gitlab cool. Unfortunately I will be in Bordeaux at https://orconf.org/
Oleg Nenashev
@oleg-nenashev
Reviewed/updated https://issues.jenkins-ci.org/secure/Dashboard.jspa?selectPageId=17346 today. Should reflect the current state, more or less
Tim Jacomb
@timja
nice!
Rodolfo Boer
@move-z
hello, i took some time to do more tests
i'm trying to replicate the configuration of an existing jenkins instance entirely with this plugin, i've just started
currently i have setup the casc plugin to load this file at startup (jenkins.yaml):
jenkins:
  labelString: master

  globalNodeProperties:
    - envVars:
        env:
          - key: PATH+LOCAL
            value: /usr/local/bin

  securityRealm:
    activeDirectory:
      startTls: true
      groupLookupStrategy: AUTO
      domains:
        - name: {{domain}}
          servers: {{dc}}:3268
          bindName: {{bind}}
          bindPassword: {{password}}
          tlsConfiguration: TRUST_ALL_CERTIFICATES

unclassified:
  location:
    url: https://{{hostname}}
sorry i'll try to improve formatting
it loads fine and all the items are set in the config except for the securityRealm (for which I already installed the active active directory plugin)
i see nothing in the logs suggesting there are problems with the entry, it just has no effect
i also tried with this simpler config instead of activeDirectory but it makes no difference:
  securityRealm:
    local:
      allowsSignup: true
an interesting detail: if I go to the configuration-as-code settings page and click "reload existing configuration", it actually gets loaded, both the local and the active directory version, so the problem seems to be only at startup
final note: i'm using jenkins 2.176.3 (current stable), active directory plugin 2.16 and configuration as code plugin 1.30
Rodolfo Boer
@move-z
i think the simplest solution would be to trigger a reload after startup using the cli or an post
any comments from the experts?
Joseph Petersen
@casz
@move-z what if you configure it in UI first and use the export feature?
@move-z I haven't used the active directory plugin. Have you considered using the ldap plugin instead?
jenkins:
  securityRealm:
    ldap:
      cache:
        size: 100
        ttl: 30
      configurations:
      - groupSearchBase: "OU=Jenkins,OU=Security Groups,OU=DevOps"
        groupSearchFilter: "(&(cn={0})(objectclass=group))"
        ignoreIfUnavailable: true
        inhibitInferRootDN: false
        managerDN: "jenkinsldap"
        managerPasswordSecret: "${LDAP_PASSWORD}"
        rootDN: "dc=company,dc=io"
        server: "ldaps://ldap.company.io:3269"
        userSearch: "sAMAccountName={0}"
      disableMailAddressResolver: false
      groupIdStrategy: "caseInsensitive"
      userIdStrategy: "caseInsensitive"
Joseph Petersen
@casz
Tim Jacomb
@timja
DevOps is a culture not a team :wink:
Joseph Petersen
@casz
@timja legacy :sob: The team is called BAT nowadays and we still try to spread DevOps :laughing:
Tim Jacomb
@timja
business acceptance testers? :wink:
batman?
Joseph Petersen
@casz
batman :laughing:
We have a whole Marvel vs DC Comics for all of our team names. And those who have adopted DevOps are called Batmen :)
The acronym for bat is Build Automate and Test :sweat_smile:
Karol Lassak
@ingwarsw
Hello guys.. din not looked at plugin development for some time.. maybe in meantime pipeline support was added?
Tim Jacomb
@timja
nope, but a webhook was added for reloading
without needing to auth
just pass a token in the url which is configured on startup
nguyenhugh
@nguyenhugh
Hello All, is it possible to have secrets lives outside of Jenkins.yaml file and a separate yaml which can have configurations for like Role Base Strategy and such?
Oleg Nenashev
@oleg-nenashev
@nguyenhugh yes to both. For secrets see https://github.com/jenkinsci/configuration-as-code-plugin#secret-sources . Regarding a separate YAML file, you can point JCasC to a directory which contains multiple YAML files. In such case all YAML files will be applied
030
@030
I would like to ask two questions: 1) How to set git-lfs using jcac? https://devops.stackexchange.com/q/9225/210 and 2) How to implement shallow clone https://devops.stackexchange.com/q/9229/210
Joseph Petersen
@casz
@030 Your seem to be using a old version of git :sweat: It should be available as traits under git.
030
@030
@casz The git-lfs command is included on the system. The issue is that GitLFSPull seems to be omitted in the Jenkins job dsl: https://jenkinsci.github.io/job-dsl-plugin/#path/job-scm-git-extensions
Joseph Petersen
@casz
what version of git do you have installed @030
Ignacio Tolstoy
@naxhh

Hi everyone! we are using casc for our new jenkins. We have a very old dated jenkins in our company and we are moving as much as we can to have things in code.
For this we use casc with a dockerfile and job-dsl with pipelines for job configurations

Now we are facing how we will deploy this system. The main idea was to start a fresh docker on each deploy since each docker version will have different configurations.
We face 2 "problems" here:

  • Build history and logs
    we loose all of this, this can be workaround with some metrics (datadog in our case) since regarding history we care more about when something started failling and not the logs per se.

  • API keys
    We switch from one docker to another during deploy. For the user this is a weird experience.
    So we want to notify the user X given time before the change. For this, we tell Jenkins A to stop running new jobs. When there are no jobs running anymore we switch to the other version.

In order to do this, we use the API and a user token. The problem is that we use LDAP plugin to make auth. This means we need a way to generate the user token in the first place. We tried different approaches but all of them look really weird...
How would you approach this last point?

Also interested in how other people is deploying CASC

Tim Jacomb
@timja
Can you log in as the user once and then create the api token via API?
there's a PR to hopefully make the second bit easier:
jenkinsci/jenkins#4027
RE: 1
We keep the build history via a docker volume and just upgrade on top of it, if there's every any issues we can just delete the volume and start from scratch
Ignacio Tolstoy
@naxhh
I don't think you can login to the api using user/pass when using ldap, but i'll ask my team mate since he is doing it.
Regarding the second, what is the path of the volume? that may work for us, but I thought config and logs where under the same path (my knowledge of jenkins is not that strong)
Tim Jacomb
@timja
/var/jenkins_home I believe
config is under the same path as well, but casc will just override it
Ignacio Tolstoy
@naxhh

ok! that last part is the one that i didn't know! thanks @timja!

Regarding the API, no, we can't use user:password for auth with ldap. That's why we need the api token, but there's no way to generate it unless we manually create it or a job does it for us (if it's possible)
That last approach is the one we are testing, but feels very hacky