Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Tushar Sisode
    @tusharsisode
    I recently upgraded to JTE 2.2.1. How do we check if a particular step is present? getBinding.hasStep no longer works which worked until 1.7.1. I know there has been some major code refactor and hasStep has been removed. Is there any alternate way to check if step exists? Cheers!
    6 replies
    Gregory Paciga
    @gpaciga
    I'm running into the same issue again, where JTE fails to check out the configured git repo and tries to fall back on running the default Jenkinsfile in jte-config. This time I'm just running on a regular branch, not a PR, on an individual/adhoc pipeline instead of a multibranch one. The issue seems to be that the branchSpec needs to start with an asterisk, so */feature/something rather than just feature/something. Presumably origin/feature/something woud also work. This is unlike when a regular pipeline from scm configuration is used. In Job DSL, JTE requires gitSCM{} but regular pipelines use just git{} which does accept just feature/something. Any thoughts on why JTE uses a different way of configuring git repos?
    one consequence of this seems to be that checkout scm does not work in a JTE pipeline
    Carlos OKieffe
    @cokieffebah
    A little late but ... Steven will be talking today around 2 p.m. US East: https://www.meetup.com/CD-Foundation-Online/events/277407348/
    yoav-klein
    @yoav-klein
    Does the latest & greatest of JTE support declarative already?
    Carlos OKieffe
    @cokieffebah
    @yoav-klein yes ^
    e88z4
    @e88z4

    Hi, I am the first time user of JTE. I am doing the jte-the-basics tutorial. When running the template, I encountered the error below:`[JTE] Obtained Pipeline Configuration File

    [JTE] Pipeline Configuration Modifications
    [JTE] Configurations Added:

    [JTE] - libraries.merge set to true

    [JTE] - libraries.sonarqube set to [:]

    [JTE] - libraries.ansible set to [:]

    [JTE] - allow_scm_jenkinsfile set to true

    [JTE] - application_environments.dev.ip_addresses set to [0.0.0.1, 0.0.0.2]

    [JTE] - application_environments.prod.long_name set to Production

    [JTE] - application_environments.prod.ip_addresses set to [0.0.1.1, 0.0.1.2, 0.0.1.3, 0.0.1.4]

    [JTE] Configurations Deleted: None

    [JTE] Configurations Changed: None

    [JTE] Configurations Duplicated: None

    [JTE] Configurations Ignored: None

    [JTE] Subsequent May Merge: None

    [JTE] Subsequent May Override: None

    [JTE] Library sonarqube exists but does not have a 'steps' or 'src' directory. Library will not be loaded.

    [JTE] Library ansible exists but does not have a 'steps' or 'src' directory. Library will not be loaded.

    [JTE] The following errors occurred: (show)
    org.boozallen.plugins.jte.util.AggregateException: The following errors occurred:

    1: Library merge not found.

    2: Library sonarqube not found.

    3: Library ansible not found.`

    1 reply
    Carlos OKieffe
    @cokieffebah
    @e88z4 you don't have libraries configured correctly. your steps, .groovy files, should be in the steps sub-directory of the library directory like ansible/steps/build.groovy.
    e88z4
    @e88z4
    @cokieffebah , thank you, your direction fixed my issue
    1 reply
    coynef
    @coynef

    Hi. Has anyone come across this error when running a JTE job...

    [JTE] Loading Library ansible (show)
    [JTE] Failed to parse step text. Library: post_deploy. Step: cleanup.
    [JTE] null (show)
    org.boozallen.plugins.jte.util.AggregateException: The following errors occurred:
    1: null

    The error is not specific to that library. It appears for all libraries.
    JTE Version 2.2.2

    6 replies
    thanh.
    @overdoz

    Hey everyone,
    i'm new to JTE and went through the docs to set up a basic configuration. Unfortunately 2 problems occurred while testing just one basic method from my shared library.

    1. Why is it only possible to evoke the Jenkinsfile from my JTE-config repo when instead i want to use the one from my features repo.

    2. My project uses a gradlew wrapper for building.
      When defining my build( ) method, the Jenkins Console tells me that no gradlew file can be found.
      In addition Jenkins won't allow to use the steps block.

      void call() {
      
       stage('Build') {
               steps {
                   sh './gradlew clean assemble testClasses'
                   sh './gradlew licenseReport --no-parallel'
               }
           }
      }

    Console often says:

    hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.jenkinsci.plugins.workflow.cps.DSL.call() is applicable for argument types: (org.jenkinsci.plugins.workflow.cps.CpsClosure2) values: [org.jenkinsci.plugins.workflow.cps.CpsClosure2@4725286a]
    Possible solutions: wait(), any(), wait(long), any(groovy.lang.Closure), each(groovy.lang.Closure), find()

    What does this mean?

    What i tried so far

    • Changing steps to node (but in the end we need steps)
    • sh 'pwd' and sh 'ls -la' but working directory was empty :(
    21 replies
    Mike Deitrick
    @mdeitrick

    We have a use case were select files need to be zipped and archived upon the pipeline's completion. I'd like to provide our developers the ability to specify zipped/archived candidates in the pipelines configuration. Since this stage should always execute, regardless of the job's status leading up to that point, I think it makes sense to execute this logic in the pipeline's post/always block. I tried adding this configuration outside the libraries block, but faced multiple compilation errors. I also tried adding a new library with this configuration (array list of objects) to access it through the pipelineConfig variable, but also faced errors there too. Presumably this has to do with only supporting certain data types, as described here. I've also considered adding a separate configuration file to handle this logic, but would prefer all pipeline configuration was consolidated in one area.

    Do you have any recommendations on how to support this feature?

    6 replies
    Joshua de Block
    @jdeblock11
    Hi everyone, I'm looking to start using the templating-engine-plugin. However, in our current implementation of our Jenkins shared library we use shared build agent that share common labels between multiple build nodes. I was following the docker build example and I tweaked it to use our build agent with label, i.e ‘docker’. However, since we have multiple build agent with the label docker, in it between each stage it would attempt to checkout a different build node. i.e in the build stage the job would use ‘build-agent-1’ and in the upload stage it would use ‘build-agent-2’ and complain that the workspace doesn't exist. Is there any way around this problem? Thanks!
    2 replies
    Mike Deitrick
    @mdeitrick

    Hello. At the very end of our template we have a step for sending a notification. Currently the two libraries are email and no-operation. The no-operation library should be loaded by default in the governance pipeline configuration, and then optionally overridden by developers. They can also leave this alone if they prefer not to be alerted after the pipeline completes. If a library is not loaded into the developer pipeline configuration for notifications, then the no-operation library is loaded successfully. But if I specify email as the library in the developer pipeline configuration, the an aggregate exception occurs.

    [JTE] There are multiple primitives with the name 'sendNotification'
    [JTE] 1. Step 'sendNotification' from the 'noopNotification' Library
    [JTE] 2. Step 'sendNotification' from the 'email' Library
    [JTE] Overlapping template primitives for names: [sendNotification] (show)

    The library section of the governance pipeline configuration is defined as such:

    @merge libraries {
        @override noopNotification
    }

    Understandably specifying @merge allows developers to include their configuration in the aggregate configuration (so the aggregate exception makes sense), but this is as close as I can get to allowing the noopNotification to be replaced with another notification library. Am I on the right track?

    4 replies
    Kishore
    @krrishkishore
    How to define inheritFrom in a generic way inside a library as an optional field to allow usage of a custom container usage to inherit few parameters from parent pod
    5 replies
    any suggestion would be helpful :)
    brewJeffcott
    @brewJeffcott
    Also want to add that I tried the Jenkins file as a scripted pipeline and got the same error. When i removed the stages from the file it ran fine. So it is appears that the stage part of the Jenkinsfile is causing it some how.
    Carlos OKieffe
    @cokieffebah

    ugh, sorry @brewJeffcott , I think I accidentally deleted your previous post. Could you repost?
    I think the issue is your 'sandbox' application_environment:

    application_environments{
        sandbox{
            stuff
        }
    }

    guessing sandbox.stuff should either be a property/variable like stuff = 1 or stuff{} , a block

    brewJeffcott
    @brewJeffcott

    Hello, I am running into what is a probably a simple error and I can't figure out what is going on. Any help would be greatly appreciated. I just have this basic Jenkinsfile:

    
    pipeline{
        agent any
        stages{
            stage("Pull Code"){
                steps {
                    script {
                        init()
                    }
                }
            }
    
            stage("Test"){
                agent {label "jenkins-maven"}
                steps {
                    container('maven') {
                        script {
                            test()
                        }
                    } 
                }
            }
        }
    }

    And before it even runs any of my code i am getting the error:

    hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.boozallen.plugins.jte.init.primitives.injectors.ApplicationEnvironment.call() is applicable for argument types: (java.lang.String, org.jenkinsci.plugins.workflow.cps.CpsClosure2) values: [Declarative: Checkout SCM, org.jenkinsci.plugins.workflow.cps.CpsClosure2@76d75b7c]
    Possible solutions: wait(), any(), find(), dump(), grep(), collect()

    My config file looks like this:

    @merge libraries{
      mulesoft
    }
    
    allow_scm_jenkinsfile = true
    
    
    application_environments{
        sandbox{
            stuff
        }
    }

    Any ideas?

    @cokieffebah the file looks like this, cut stuff out to simplify it:
    
    libraries{
      mulesoft
    }
    
    allow_scm_jenkinsfile = true
    
    
    application_environments{
        sandbox{
            long_name = "Sandbox"
            prefix = "blah"
            suffix = "sandbox"
            environmentId = "blah"
            organizationId = "blah"
        }
    
        exchange{
            long_name = "Exchange"
            prefix = ""
            suffix = ""
            environmentId = ""
            organizationId = "blah"
        }
    
        stage{
            long_name = "Stage"
            prefix = "blah"
            suffix = "stage"
            environmentId = "blah"
            organizationId = "blah"
        }
    
        prod{
            long_name = "Production"
            prefix = "blah"
            suffix = "prod"
            environmentId = "blah"
            organizationId = "blah"
        }
    
        load_test{
            perform_test = false
        }
    }
    Carlos OKieffe
    @cokieffebah

    @brewJeffcott , this happens ...

    stage{
            long_name = "Stage"
            prefix = "blah"
            suffix = "stage"
            environmentId = "blah"
            organizationId = "blah"
        }

    overrode the word stage in stage("Pull Code") and stage("Test") in your template, rename your application_environments.stage to another name

    brewJeffcott
    @brewJeffcott
    haha. crap. Thanks for catching that! Much appreciated!
    e88z4
    @e88z4
    Is there an example of a named pipeline template? I am trying to create different template for each group in my organization. Currently, I have a single Jenkinsfile and pipeline_config.groovy in a folder named "pipeline-configuration". How is the folder structure going to change? Does it support multiple pipeline_config.groovy per template? I didn't find example anywhere.
    Does it support multiple pipeline_config.groovy per template ?
    its inverted, the pipeline_config.groovy defines its named template via :
    jte{
       pipeline_template = 'my named template'
    }
    e88z4
    @e88z4

    @e88z4 did you see this section? https://boozallen.github.io/sdp-docs/jte/2.2.2/governance/pipeline_template_selection.html#_2_named_pipeline_template

    Yes, I saw that documentation yesterday. It seems I only need to create a folder named "pipeline-templates" then put my template there. Any pipeline_config.groovy can reference this template

    Dan Williams
    @deedubs
    I too am having issues with my JTE pipeline_templates. I have my jte block jte { pipeline_template = "terraform"} and then jenkins-libraries/governance/pipeline_templates/terraform but it's resolving to jenkins-libraries/governance/Jenkinsfile
    Dan Williams
    @deedubs
    @e88z4 Were you able to get it working?
    I always see
    [JTE] Obtained Template (hide)
    [JTE] -- scm: git https://***/****/jenkins-libraries.git
    [JTE] -- file path: governance/Jenkinsfile
    Carlos OKieffe
    @cokieffebah
    @e88z4 @deedubs are your 'pipeline_templates' in a governance tier or are you trying to use pipeline_templates in your job/project (which wont work)
    Dan Williams
    @deedubs
    @cokieffebah It's in my top level governance tier
    image.png
    Dan Williams
    @deedubs
    I also just noticed this higher up the logs :/
    [JTE] Configurations Ignored:
    [JTE] - jte.pipeline_template
    Dan Williams
    @deedubs
    Okay so I removed this block from my governance pipeline_config.groovy and now it's working :/
    @merge jte {
        allow_scm_jenkinsfile = true
    }
    Mike Deitrick
    @mdeitrick
    Presently our group has unit tests written for all our libraries and governance pipelines, but are performing manual integration testing. We only have about 5 different combos of libraries that developers can specify in their pipeline configuration, but this number is expected to grow exponentially in the near future. I've been exploring different ways to ensure automated integration testing is a part of the software development lifecycle, and thus far I've only come up with iterating over individual pipelines with different configurations to fully test changes. The process works for the most part but seems clunky. Do you have any recommendations for teams that want to do automated integration testing with different combos of pipeline libraries and their respective configurations?
    1 reply
    yoav-klein
    @yoav-klein

    Hi @cokieffebah. I had this step as a @Cleanup step:

    @CleanUp
    void sendMail(context) {
      def html = '${JELLY_SCRIPT}, template="html"'
      config.recipients.each { recipient ->
         emailext body: html, subject: '$DEFAULT_SUBJECT', to: recipient
    }

    This used to work well with JTE 1.x: when a job failed, it sent JOB FAILED. But once I upgraded to JTE 2.x, it always sends SUCCESS.
    Any idea why this happening?

    2 replies
    Kishore
    @krrishkishore
    jenkinsci/templating-engine-plugin#187 - is occurring again and again in my case. The jenkins job successfully completes initially after some time that job updates with the provided information not sure why that it is getting updated to failed.
    Carlos OKieffe
    @cokieffebah
    @krrishkishore create a new issue. I suspect it is not 'exactly' the same. If others, in addition to you, start reporting regressions, we will consider the previous code 'regressed'
    Madhuri1518
    @Madhuri1518_gitlab
    @cokieffebah I am facing same issue again(jenkinsci/templating-engine-plugin#187)
    Previously the issue is closed because of missing reproducible steps.
    I have provided the minimum reproducible steps. So Please reopen the above issue.
    Thanks
    1 reply
    Tushar Sisode
    @tusharsisode
    How do we get libraries defined in pipeline_config in JTE 2.2.2? Until JTE1.7.1 I used something like getBinding().getVariable('pipelineConfig).libraries but this approach no longer works for JTE2.2.2. Any help would be appreciated. Cheers!
    Carlos OKieffe
    @cokieffebah
    @tusharsisode the strings should be available under pipelineConfig.libraries
    Tushar Sisode
    @tusharsisode
    Thanks @cokieffebah . This worked like a charm.
    mxkmp
    @mxkmp
    Hey, I'm migrating to JTE 2.2 and I have two questions: For what is the template catalog which I see under the jenkins configuration and how can I use it? And is there a possibility to configure monorepos with a pipeline_config.groovy per Service? Currently we have N Services with N*2 Pipelines (build + deploy) and it would be nice to have the abillity to define general pipeline configuration for specific use cases or to have the abillity to grep for the specific configurations
    3 replies
    Carlos OKieffe
    @cokieffebah
    @krrishkishore @Madhuri1518_gitlab I reopened jenkinsci/templating-engine-plugin#187. Can't guarantee when it will be worked any time soon
    Serpa
    @serpa-dystematic

    Hey guys, I've updated JTE to the latest version 2.2.2 and the variables defined as such:

    String someFunction() {
      String stillGoodVariable = "foo"
      notWorkingVariable = "bar"
    }

    The variable notWorkingVariable is not accessible outside of the function, as previously was. Is there any recommended way to store values that we only want to fetch once per build, but that need to be used across the pipeline?

    Thanks :)

    7 replies
    Sanchit Lohia
    @sanchitlohia2711
    I am running into an issue while using JTE. Does anyone know the resolution to it Error is hudson.remoting.ProxyException: java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons; see https://jenkins.io/redirect/class-filter/
    6 replies
    srveerla
    @srveerla
    jenkinsci/templating-engine-plugin#187 : Can someone helpus with this issue?
    Carlos OKieffe
    @cokieffebah
    @krrishkishore , @srveerla did jenkinsci/templating-engine-plugin#187, just start happening for you? did you upgrade or add some new plugins?
    5 replies
    also can you add you error messages/logs to the github issue
    Serpa
    @serpa-dystematic
    Hey guys! We need to speed up some nodejs builds that take a lot of time mainly due to dependencies installation. Is there any way you guys are caching this type of resources between builds? Thanks :)