skip to Main Content

I am trying to create a user and password for Jenkins using JCASC. I can set up Jenkins however when I go to the GUI on my local host I do not see any users. Here is my code

jenkins:
  systemMessage: "Jenkins configured automatically by Jenkins Configuration as Code pluginnn"
  disabledAdministrativeMonitors:
      - "jenkins.diagnostics.ControllerExecutorsNoAgents"
credentials:
  system:
    domainCredentials:
    - credentials:
      - usernamePassword:
          id: "admin-cred"
          username: "jenkins-admin"
          password: "butler"
          scope: GLOBAL

I believe I have all the necessary plugins installed but something is missing clearly. Any help would be appreciated.

2

Answers


  1. The way I got users to pop up is by setting up the (local) security realm, rather than credentials, like so:

    jenkins:
      securityRealm:
        local:
          users:
           - id: jenkins-admin
             password: butler
    

    I’m finding this a great resource to get ideas from: https://github.com/oleg-nenashev/demo-jenkins-config-as-code

    Login or Signup to reply.
  2. I’ve used a local security Realm with disabled signups to add the user "jenkins-admin".

    jenkins:
        . . .
        securityRealm:
            local:
                allowsSignup: false
                users: 
                    - id: jenkins-admin
                      password: butler
    

    You can refer below links to know more about Jcasc:

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search