by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:19
    jetersen commented #1429
  • 18:06
    efim-a-efim labeled #1429
  • 18:06
    efim-a-efim opened #1429
  • 17:07
  • Jul 08 21:00
    Chinmay922 edited #1428
  • Jul 08 21:00
    Chinmay922 edited #1428
  • Jul 08 21:00
    Chinmay922 edited #1428
  • Jul 08 20:54
    Chinmay922 commented #1382
  • Jul 08 20:52
    Chinmay922 commented #1428
  • Jul 08 20:50
    Chinmay922 edited #1428
  • Jul 08 20:50
    Chinmay922 edited #1428
  • Jul 08 20:50
    Chinmay922 edited #1428
  • Jul 08 20:49
    Chinmay922 edited #1428
  • Jul 08 20:49
    Chinmay922 review_requested #1428
  • Jul 08 20:49
    Chinmay922 opened #1428
  • Jul 08 20:27
    alok15ee commented #1024
  • Jul 08 20:27
    alok15ee commented #1024
  • Jul 08 16:20
    alok15ee commented #1024
  • Jul 08 15:45
Endre Karlson
@ekarlso_twitter
is there any bugs or so with the casc 1.41 plugin that can cause this with yaml ?
Tim Jacomb
@timja
as you using jenkins operator @ekarlso_twitter ?
Endre Karlson
@ekarlso_twitter
@MadsJakobsen Yo, did you get jenkins-operator to work with 1.41 ?
@timja indeed

Actually I became adventorous and updated to HEAD, but now I get other fun problems like
2020-06-29T11:59:44.110Z INFO controller-jenkins groovy/groovy.go:145 user-casc ConfigMap '04-configure-jenkins' name '04-configure-jenkins.yaml' running groovy script {"cr": "jenkins"}

```
2020-06-29 11:59:45.051+0000 [id=13] WARNING i.j.p.c.i.s.PropertiesSecretSource#reveal: Source properties file /var/jenkins/configuration-as-code-secrets could not be loaded
java.io.FileNotFoundException: /var/jenkins/configuration-as-code-secrets (Is a directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at io.jenkins.plugins.casc.impl.secrets.PropertiesSecretSource.reveal(PropertiesSecretSource.java:46)
at io.jenkins.plugins.casc.SecretSourceResolver.lambda$null$aeeb512d$1(SecretSourceResolver.java:78)
at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
at io.jenkins.plugins.casc.SecretSourceResolver.lambda$reveal$0(SecretSourceResolver.java:78)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:531)
at io.jenkins.plugins.casc.SecretSourceResolver.reveal(SecretSourceResolver.java:80)
at io.jenkins.plugins.casc.SecretSourceResolver.access$000(SecretSourceResolver.java:18)
at io.jenkins.plugins.casc.SecretSourceResolver$ConfigurationContextStrLookup.lambda$lookup$1(SecretSourceResolver.java:63)
at io.vavr.Tuple2.apply(Tuple2.java:238)
at io.jenkins.plugins.casc.SecretSourceResolver$ConfigurationContextStrLookup.lookup(SecretSourceResolver.java:62)
at org.apache.commons.lang.text.StrSubstitutor.resolveVariable(StrSubstitutor.java:726)
at org.apache.commons.lang.text.StrSubstitutor.substitute(StrSubstitutor.java:649)
at org.apache.commons.lang.text.StrSubstitutor.substitute(StrSubstitutor.java:563)
at org.apache.commons.lang.text.StrSubstitutor.replace(StrSubstitutor.java:305)
at io.jenkins.plugins.casc.SecretSourceResolver.resolve(SecretSourceResolver.java:40)
at io.jenkins.plugins.casc.impl.configurators.PrimitiveConfigurator.configure(PrimitiveConfigurator.java:45)
at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:160)
at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.instance(DataBoundConfigurator.java:77)
at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(HeteroDescribableConfigurator.java:86)
at io.vavr.control.Option.map(Option.java:392)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
at io.vavr.Tuple2.apply(Tuple2.java:238)
at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
at io.jenkins.plugins.casc.impl.configurat

Tim Jacomb
@timja
best to ask in the community channel for jenkins-operator https://github.com/jenkinsci/kubernetes-operator#community @ekarlso_twitter
Endre Karlson
@ekarlso_twitter
Thnx @timja
Adrien Lecharpentier
@alecharp
@timja do we have an office hour today?
Tim Jacomb
@timja

CDF Jenkins Zoom is inviting you to a scheduled Zoom meeting.

Topic: Jenkins Config-as-Code project meeting
Time: This is a recurring meeting Meet anytime

Join Zoom Meeting
https://zoom.us/j/91834682565?pwd=KzVoWG5jck1oUTg5UGFWcjMzM3c1QT09

Meeting ID: 918 3468 2565
Password: 008002
One tap mobile
+13462487799,,91834682565#,,,,0#,,008002# US (Houston)
+16699006833,,91834682565#,,,,0#,,008002# US (San Jose)

Dial by your location
+1 346 248 7799 US (Houston)
+1 669 900 6833 US (San Jose)
+1 929 205 6099 US (New York)
+1 253 215 8782 US (Tacoma)
+1 301 715 8592 US (Germantown)
+1 312 626 6799 US (Chicago)
888 788 0099 US Toll-free
877 853 5247 US Toll-free
Meeting ID: 918 3468 2565
Password: 008002
Find your local number: https://zoom.us/u/adrsNYqGel

@alecharp yes
@alecharp you joining?
no one seems to be here
Adrien Lecharpentier
@alecharp
"waiting for the organizer to start"...
odd
Tim Jacomb
@timja
hmm
it's started =/
can you try rejoin
Adrien Lecharpentier
@alecharp
that was efficient. thank you @timja
Tim Jacomb
@timja
:D
Wadeck Follonier
@Wadeck
Hey there, do you have a way to "assume not Windows" in a JCasC test (using JenkinsConfiguredWithCodeRule and @ConfiguredWithCode) ? The descriptor is dynamically enabled depending on the system, and thus, for Windows, the descriptor is not present and fail the test before any code is executed.
3 replies
Gavin Mogan
@halkeye
Ugh got hit by another dependabot swarm. Anyone know offhand what the config key is for limiting the number of k8s pods being created. I can dig into it later if nobody knows offhand
mukesh1011
@mukesh1011
want to use http post method and also want to provide file to load. Any example would be great help/
tavolodobela
@tavolodobela
Hello
I'd like to get some help with jenkins as a code plugin
I have a seed job configured in code to clone a repo and create the jobs
eg.
          git {
              remote {
                branch('$BRANCH')
                refspec('$REFSPEC')
              }
However, jenkins prefers ${BRANCH} not simply $BRANCH
How could I introduce the { and } to the branch variable name?
search escape
tavolodobela
@tavolodobela
thanks Tim, it works :-)
Bluedread
@bluedread

Hi, we're trying to set up Jenkins credentials using JCAC and the Vault Plugin.

Setting up Vault and using it to read secrets in Pipelines and Jobs works fine, but when we try to set up a Jenkins Credential we get an error:

| 2020-07-06 10:03:55.154+0000 [id=32]    SEVERE    jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init
jenkins    | io.jenkins.plugins.casc.ConfiguratorException: secret is required to configure class org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:133)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.instance(DataBoundConfigurator.java:77)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
jenkins    |     at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(HeteroDescribableConfigurator.java:86)
jenkins    |     at io.vavr.control.Option.map(Option.java:392)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
jenkins    |     at io.vavr.Tuple2.apply(Tuple2.java:238)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:55)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:152)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.instance(DataBoundConfigurator.java:77)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.check(DataBoundConfigurator.java:101)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:344)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:351)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
jenkins    |     at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:755)
jenkins    |     at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:691)

JCasC config for Vault in the Jenkins.yaml:

credentials:
  system:
    domainCredentials:
      - credentials:
      # needs 4 spaces of identing
          - VaultAppRoleCredential:
              description: "Vault credentials"
              id: "vault_app_role"
              scope: GLOBAL
              roleId: "${CASC_VAULT_APPROLE}"
              secretId: "${CASC_VAULT_APPROLE_SECRET}"
          - string:
              description: "Slack token"
              id: "slack-token"
              scope: GLOBAL
              token: "${slack-token/secret}"

When we remove the botom string block, everything works as expected.

We're passing CASC_VAULT_APPROLE, CASC_VAULT_APPROLE_SECRET and CASC_VAULT_PATHS into the container where Jenkins runs, and use FROM jenkins/jenkins:lts as the base image for our Jenkins container.

We verified that the CASC_VAULT_APPROLE and CASC_VAULT_APPROLE_SECRET work to read secrets from Vault. The CASC_VAULT_PATHS has also been tested in Vault: vault kv get ${CASC_VAULT_PATHS}/slack-token gives the expected result. What would be a good way to troubleshoot the error above?
Bluedread
@bluedread

Update on this: today I tried to set the secret in the GUI, and then export it and try that configuration.

So, my jenkins.yaml credentials looked like this:

credentials:
  system:
    domainCredentials:
      - credentials:
      # needs 4 spaces of identing
          - VaultAppRoleCredential:
              description: "Vault credentials"
              id: "vault_app_role"
              scope: GLOBAL
              roleId: "${CASC_VAULT_APPROLE}"
              secretId: "${CASC_VAULT_APPROLE_SECRET}"

Then, I added a secret using the GUI, (type: Vault String), and used the CasC export function (http://localhost:8080/configuration-as-code/viewExport) to see what the yaml file should look like:

credentials:
  system:
    domainCredentials:
    - credentials:
      - vaultAppRoleCredential:
          description: "Vault credentials"
          id: "vault_app_role"
          path: "approle"
          roleId: "redacted_for_obvious_reasons"
          scope: GLOBAL
          secretId: "redacted_for_obvious_reasons"
      - vaultStringCredentialImpl:
          description: "slack token"
          engineVersion: 2
          id: "slack-token"
          path: "some_path"
          scope: GLOBAL
          vaultKey: "secret"

However, using this results in a different error:

jenkins    | java.lang.IllegalArgumentException: Single entry map expected to configure a com.cloudbees.plugins.credentials.Credentials
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configureMapping(HeteroDescribableConfigurator.java:269)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.preConfigure(HeteroDescribableConfigurator.java:251)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:55)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:152)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.instance(DataBoundConfigurator.java:77)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
jenkins    |     at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.check(DataBoundConfigurator.java:101)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:344)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:351)
jenkins    |     at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
jenkins    |     at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:755)
jenkins    |     at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:691)
jenkins    |     at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:755)
jenkins    |     at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:740)
jenkins    |     at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:616)
jenkins    |     at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:298)
jenkins    |     at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:290)
jenkins    | Caused: java.lang.reflect.InvocationTargetException

Any tips for troubleshooting would be very welcome.

Tim Jacomb
@timja
Probably worth raising that with the maintainers of the vault plugin directly ^^
@bluedread
Bluedread
@bluedread
Thanks @timja, will do.
Bluedread
@bluedread

Latest update: it seems the Vault Plugin syntax has been changed, I was able to get it working with the Yaml in the post above, after removing some commented lines in my file which probably ruined the indenting.

I'll create a PR for the Vault Plugin docs, they haven't been updated with the change to the code so their example (yaml file in my first post) is outdated.

Carlos Martinez
@Curlos
Hi everyone, quick question. Can Configuration as Code be used on a Linux virtual machine with no GUI? I'm thinking that the jenkins.yaml file could be created on my host machine, I transfer the file to the virtual machine and then maybe place it in a directory related to Jenkins so plugins, ldap settings, etc would be configured. Is this possible?
6 replies
Carlos Martinez
@Curlos

Hi all, I had another question about configuration as code. Using the Jenkins CLI, I installed it on a Linux virtual machine with no GUI by using this command:

'java -jar jenkins-cli.jar -s http://localhost:8080/ -auth username:password install-plugin http://updates.jenkins-ci.org/download/plugins/configuration-as-code/latest/configuration-as-code.hpi'

which places the plugin into the directory: '/var/lib/jenkins/plugins'.

However, when I try running this command:

'java -jar jenkins-cli.jar -s http://localhost:8080/ -auth username:password check-configuration <jenkins.yaml'

I get the following error: 'No such command check-configuration'.

Did I install the plugins incorrectly? When I run 'java -jar jenkins-cli.jar -s http://localhost:8080/ -auth username:password list-plugins' I do not see configuration as code plugin appear under there.
Mark Waite
@MarkEWaite
@Curlos See my answer posted to https://gitter.im/jenkinsci/jenkins . Installing plugins is not a feature of the configuration as code plugin
Carlos Martinez
@Curlos
@MarkEWaite Alright, thank you Mark
Graeme Wilson
@techlunacy
hi all, is the custom tools plugin compatible with JCasc?
14 replies