Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Artem Gryshyn
    @Nobiscum
    I defined $ENV variable as String parameter
    navrkald
    @navrkald

    Hello all, I am starting to learn Jenkins Template engine and I would like to ask you it there is way how to version Templates in code?
    I mean something similar like in Jenkins Shared Library where in Jenkinsfile in multi-branch pipeline I can use something like this:

    library identifier: 'libraryName@<git version>', retriever: modernSCM([
        $class: 'GitSCMSource',
        credentialsId: 'someCredentialsId',
        remote: 'https://some-git-provider/someLibraryRepoName.git'
    ])

    where <git version> could be branch/commit/git tag, e.g. v1.2.3.
    I am asking because this approach allows manage library configuration as a code and allows to possibly use different versions of library in different branches in consumer multi-branch pipeline. The main benefit of this approach is that breaking change or possible uncaught bug couldn't cause breaking all consumers at the same time and as when updating to next version it is done via PR which goes via Jenkins CI which helps to catch most of the problems.

    As far as I have found right now it is possible to configure Jenkins Templates only via GUI as visible e.g. here
    alt
    but his not allow to use different version of Template in different branches in multi-branch pipeline or in different repositories in Jenkins organisation folder.
    As well this problem with missing versioning was mentioned in StackOverflow

    2 replies
    Gregory Paciga
    @gpaciga
    Is there an easy way to get access to the original Jenkins steps when it's overwritten by a Template primitive? i.e., I have a JTE libraries that provide a build() step, but this overwrites Jenkins' built in build() step . I know loading two libraries with the same step is possible now with namespaces, but is there any hope for vanilla JTE steps? (Yes, obviously renaming the JTE functions is probably the "right" solution, but creates a lot more moving parts to juggle)
    1 reply
    Serpa
    @serpa-dystematic
    Hey @cokieffebah ! Is it possible to have a Map in the library_config.groovy configs?
    I've read the docs and it looks like it is not supported, but wondering if anyone has done this so far.
    4 replies
    kuchanamounika
    @kuchanamounika

    Hi Team
    We are getting below issue after running the JTE pipeline in jenkins because of Prometheus plugin, if we uninstalled plugin the issue resolved , but it revoked if we install the Prometheus plugin again.

    Can any one suggest the solution for it?

    Resuming build at Fri Dec 10 11:34:27 UTC 2021 after Jenkins restart
    [Pipeline] End of Pipeline
    java.io.FileNotFoundException: /var/jenkins_home/jobs/ads/jobs/paas/jobs/test/jobs/a877006/jobs/JTE/jobs/MTA-metadata/jobs/metadata-test/builds/28/program.dat (No such file or 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 org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReader.openStreamAt(RiverReader.java:188)
    at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverReader.restorePickles(RiverReader.java:136)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramAsync(CpsFlowExecution.java:784)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:750)

    srveerla
    @srveerla
    Hi All,
    The above issue reported earlier as well and we were able zero it on Prometheus plugin, it seems JTE and Prometheus plugin are conflicting. When we have plugin installed JTE job which has already passed get the the status changed to Fail however the build log still refer to Jobs as Success.
    srveerla
    @srveerla
    @cokieffebah : Can you take a look at above issue
    Carlos OKieffe
    @cokieffebah
    @srveerla could you submit a bug/issue on the plugin site. On initial viewing, it seems similar to the other pipeline restart issues.
    Kishore
    @krrishkishore
    @cokieffebah there was a ticket which was opened with the same stack trace : jenkinsci/templating-engine-plugin#187
    Carlos OKieffe
    @cokieffebah
    thanks @krrishkishore
    1 reply
    mdeitrick
    @mdeitrick
    Has anyone ran into performance issues while running integration tests locally on a Windows machine? These integration tests (setup and verified with jenkins-test-harness) run fairly quickly on our remote CloudBees SDA environment but I'm noticing a huge slowdown when loading libraries; immediately before injecting into the templated pipeline, but after loading the pipeline configuration. Not sure if there are optimal JVM arguments that should be taken into account when testing locally...
    1 reply
    Carlos OKieffe
    @cokieffebah
    honestly, most of our internal SDP work/testing was done with Mac's when working locally. @mdeitrick
    Wayonb
    @Wayonb

    Hi,
    I have several Named Pipeline Template in my governance tier and wanted each repo to select which template to used.
    In the repo pipeline_config.groovy configuration file, added the following

    jte {
        pipeline_template = "Jenkinsfile.python"
    }

    It seem pipeline_template is ignore in the application repo. Is there another way to select a template file?

    [JTE] Configurations Ignored:
    [JTE] - jte.pipeline_template

    Thanks.

    3 replies
    Hamsalekha Venkatesh
    @Hamsalekha-Venkatesh
    org.boozallen.plugins.jte.util.JTEException: Binding collision with JTE template primitive
    Serpa
    @serpa-dystematic
    Hey there. Idk if this question is for here, but plz advise.
    There are some builds that I fully want to "ignore" and not even report "success" to, in my case, bitbucket. But I cannot configure bitbucket to not trigger those builds.
    Is there anyway to exit the build before those feedbacks are sent to the scm?
    3 replies
    Serpa
    @serpa-dystematic

    @cokieffebah is it possible to get the name of the pipeline template running from the steps?
    I've tried jte.pipeline_template (and variants) but they all fail with:

    [ERROR]: org.boozallen.plugins.jte.util.JTEException: JTE does not have Template Namespace pipeline_template

    Thanks!

    6 replies
    ben-mcclain
    @ben-mcclain

    How do I use a specific agent in one of my JTE steps? Specifically I want to use a docker container but I'm getting this error message when running it: java.lang.NoSuchMethodError: No such DSL method 'agent' found among steps [archive, bat, build,

    This is my step:

    void call(){
      agent {
        docker {
            image 'public.ecr.aws/lambda/python:3.9-x86_64'
            reuseNode true
        }
      }
      steps{
        println "Linting code."
      }
    }

    My Jenkinsfile is simply:

    lint()
    2 replies
    ben-mcclain
    @ben-mcclain

    Hi there!
    I have a standard pipeline job where I have enabled JTE. I have it configured to pull the pipeline configuration from a git repo, rather than puttingit into the console. I've set the Pipeline Configuration Path in the job's config to the filename I have in the repo, which is the standard pipeline_config.groovy at the root of the repo. When running this job though, it is ignoring the file. However, if I define this pipeline configuration in the console, rather than via SCM, it works as intended. It is as if the job does not retrieve the source code of the job before trying to run it. Indeed, when running a multi-branch pipeline it shows these steps:

    [JTE] Obtained Pipeline Configuration File (show)
    [JTE] Pipeline Configuration Modifications (show)
    19:39:37 Connecting to https://api.github.com using Username/****** (Username)
    [JTE] Obtained Template Configuration File (show)
    [JTE] Pipeline Configuration Modifications (show)
    [JTE] Loading Library sonarqube (show)
    [JTE] Loading Library python (show)
    [JTE] Obtained Repository Jenkinsfile (show)
    [JTE] Repository provided Jenkinsfile that will not be used, per organizational policy.
    [JTE] Obtained Pipeline Template (show)
    [Pipeline] Start of Pipeline

    While this is what shows in the standard pipeline:

    [JTE] Obtained Pipeline Configuration File (show)
    [JTE] Pipeline Configuration Modifications (show)
    [JTE] Loading Library sonarqube (show)
    [JTE] Obtained Pipeline Template (show)
    [Pipeline] Start of Pipeline

    Note that the Connecting to https://api.github.com.... step is not run for the standard pipeline. It just jumps right into the running of the pipeline template defined in the global pipeline-configuration.

    Srinivas Reddy
    @solipuram

    Hello
    Have run Sample JTE Demo on On last week back it was successfully ran. But today when I am running same Job it throwing the below error as Library is not found.

    [JTE] sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [JTE] sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    [JTE] sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    [JTE] java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    [JTE] org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
    [JTE] org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
    [JTE] org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
    [JTE] org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
    [JTE] org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:239)
    [JTE] org.boozallen.plugins.jte.init.primitives.injectors.LibraryStepInjector.validateConfiguration(LibraryStepInjector.groovy:46)
    [JTE] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [JTE] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [JTE] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [JTE] java.lang.reflect.Method.invoke(Method.java:498)
    [JTE] org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    [JTE] groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    [JTE] groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
    [JTE] groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
    [JTE] groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:810)
    [JTE] org.boozallen.plugins.jte.init.primitives.TemplatePrimitiveInjector.invokeMethod(TemplatePrimitiveInjector.groovy)
    [JTE] groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)
    [JTE] org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    [JTE] groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)
    [JTE] org.boozallen.plugins.jte.init.primitives.TemplatePrimitiveInjector$_invoke_closure1.doCall(TemplatePrimitiveInjector.groovy:144)
    [JTE] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [JTE] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [JTE] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [JTE] java.lang.reflect.Method.invoke(Method.java:498)
    [JTE] org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    [JTE] groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    [JTE] org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
    [JTE] groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
    [JTE] groovy.lang.Closure.call(Closure.java:414)
    [JTE] groovy.lang.Closure.call(Closure.java:430)
    [JTE] org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2040)
    [JTE] org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
    [JTE] org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
    [JTE] org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
    [JTE] org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    [JTE] org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    [JTE] org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    [JTE] org.boozallen.plugins.jte.init.primitives.TemplatePrimitiveInjector.invoke(TemplatePrimitiveInjector.groovy:139)
    [JTE] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [JTE] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [JTE] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [JTE] java.lang.reflect.Method.invoke(Method.java:49

    Serpa
    @serpa-dystematic
    Hey there guys, has any of you wanted to implement "priorities" so that Jenkins can schedule some builds first than others? cc: @cokieffebah
    2 replies
    Serpa
    @serpa-dystematic
    Another one :smile: : Is it possible to dynamically include libraries? For example, I have some libs that depend on another. Instead of including it in global pipeline_config or in projects' one, I could include it whenever the libs that depend on it are included.
    4 replies
    Naveenkumar
    @vrnaveenkr

    @all
    Hello all I'm just exploring JTE. And I have a small problem configuring Sonarqube on JTE..
    How to convert the below piece of code in JTE sonarqube library template
    sonar.projectKey=sonarqube
    sonar.login=admin
    sonar.password=Welcome@1
    sonar.sources=/var/jenkins_home/workspace/sqjob_test
    sonar.host.url=http://10.10.1.1:9000/
    Sorry if it is silly I'm just exploring
    To be more precise I want the below task to be converted in to Sonarqube library

    stage('Ansible Linting'){
    steps{
    sh '''#!/bin/bash
    source /disk1/bin/python3-virtualenv/bin/activate
    pip install ansible
    pip install "ansible-lint[yamllint]"
    ansible-lint --version
    /disk1/bin/sonar-scanner-4.6.0.2311-linux/bin/sonar-scanner -Dsonar.host.url=https://xxx
    -Dsonar.projectName=${REPOSITORY}
    -Dsonar.projectVersion=${PROJECT_VERSION}
    -Dsonar.inclusions=\'/*.yaml, /*.yml\'
    -Dsonar.sourceEncoding=${SONAR_SOURCE_ENCODING}
    -Dsonar.projectKey=${REPOSITORY_TYPE}:${REPOSITORY}
    -Dsonar.branch.name=${TARGET_BRANCH}
    -Dsonar.sources=${SONAR_SOURCES}
    -Dsonar.projectBaseDir=${WORKSPACE}'''
    }

    2 replies
    akatumalla27
    @akatumalla27
    Hi all, I new to the Template Plugin. I am trying to implement follow the JTE basics tutorial. The setup is very simple as explained in the tutorial but I get the error below
    [2022-02-01T02:34:29.399Z] [JTE] Obtained Pipeline Configuration File 00:00:00.658 [JTE] -- scm: git https://bitbucket.org/repo-name/test-jte.git 00:00:00.658 [JTE] -- file path: pipeline-configuration/pipeline_config.groovy 00:00:00.968 [2022-02-01T02:34:29.710Z] [JTE] Pipeline Configuration Modifications 00:00:00.969 [JTE] Configurations Added: 00:00:00.969 [JTE] - libraries.maven set to [:] 00:00:00.970 [JTE] Configurations Deleted: None 00:00:00.970 [JTE] Configurations Changed: None 00:00:00.971 [JTE] Configurations Duplicated: None 00:00:00.971 [JTE] Configurations Ignored: None 00:00:00.972 [JTE] Subsequent May Merge: 00:00:00.972 [JTE] - libraries 00:00:00.972 [JTE] Subsequent May Override: None 00:00:01.209 [2022-02-01T02:34:29.951Z] [JTE] The following errors occurred: (show) 00:00:01.239 org.boozallen.plugins.jte.util.AggregateException: The following errors occurred: 00:00:01.239 1: Library maven not found. 00:00:01.239 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 00:00:01.239 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 00:00:01.239 at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 00:00:01.239 at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) 00:00:01.239 at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83) 00:00:01.239 at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105) 00:00:01.239 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60) 00:00:01.239 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235) 00:00:01.239 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:239) 00:00:01.239 at org.boozallen.plugins.jte.init.primitives.TemplatePrimitiveInjector.invoke(TemplatePrimitiveInjector.groovy:138) 00:00:01.239 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 00:00:01.239 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 00:00:01.239 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 00:00:01.239 at java.base/java.lang.reflect.Method.invoke(Method.java:566) 00:00:01.239 at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) 00:00:01.239 at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) 00:00:01.239 at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46) 00:00:01.239 at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102) 00:00:01.239 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56) 00:00:01.239 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194) 00:00:01.240 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:222) 00:00:01.240 at org.boozallen.plugins.jte.init.primitives.TemplatePrimitiveInjector.orchestrate(TemplatePrimitiveInjector.groovy:87) 00:00:01.240 at org.boozallen.plugins.jte.init.primitives.TemplatePrimitiveInjector$orchestrate.call(Unknown Source) 00:00:01.240 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) 00:00:01.240 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) 00:00:01.240 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) 00:00:01.240 at org.boozallen.plugins.jte.init.PipelineDecorator.in
    4 replies
    image.png
    The directory structure is
    image.png
    Serpa
    @serpa-dystematic
    Hey guys, is anyone using JTE with pods in kubernetes? If yes, anything that I should take in consideration? What plugin or strategy are you using? Thanks :raised_hands:
    7 replies
    akatumalla27
    @akatumalla27

    Hi everyone, quick question. Is it possible to run parallel stages like we can do in a Jenkinsfile ?

    parallel {
       stage('AMD64')
       stage('ARM64')
    }

    Thanks for any replies

    2 replies
    Serpa
    @serpa-dystematic

    Hey guys! Is it possible to load the pipeline_config.groovy of a project into an object variable during the build?
    The objective is to add/remove new/deprecated configs without having to do that in ALL repos and using the pipeline to do it.

    I know there's a pipelineConfig variable available, but that brings all configuration merged and I only want those that the project brings before the merge.

    If yes, which method can I use?
    I've checked the PipelineConfigurationObject, but it needs a flowOwner that idk where to get that from and

    3 replies
    akatumalla27
    @akatumalla27
    Hey.. I am curious regarding what the typical adoption strategy is for JTE for teams that have been using declarative syntax Jenkinsfile. How can the Jenkinsfile and JTE coexist in the same repo for different branches using multibranch pipelines? As I understand the allow_scm_jenkinsfile = true option only works for scripted Jenkinsfiles..Thank you
    mdeitrick
    @mdeitrick

    Hey guys, is anyone using JTE with pods in kubernetes? If yes, anything that I should take in consideration? What plugin or strategy are you using? Thanks :raised_hands:

    I wanted to follow-up on this post in a separate thread. We're trying to do the same thing but the pipeline reports the DSL method 'agent' can't be found. This is only happening while running a pipeline with a JTE definition. All other custom pipelines are that use Kubernetes pods are running just fine.

    Basically we're just loading some global libraries and the beginning of the pipeline looks like this...

    pipeline {
      agent {
        kubernetes {
            defaultContainer('jnlp')
            yamlFile(pipelineConfig.kubernetesPodLocation)
        }
      }
      // additional steps below...
    }

    And the error reported is "No such DSL method 'agent' could be found", or something of that nature. Am I missing something?

    3 replies
    e88z4
    @e88z4

    Hi,

    I am having issue loading pipeline configuration when doing a pull request build using Bitbucket branch plugin. When I do the branch and tag builds, the pipeline configuration are loaded properly from every repo. The difference in the JTE log is very obvious.

    Below is the branch and tag build example with more libraries being loaded

    [JTE] Obtained Pipeline Configuration File
    [JTE] -- scm: git ssh://[git@bitbucket.mydomain.com/csma/jte-pipeline-configuration.git](http://git@bitbucket.mydomain.com/csma/jte-pipeline-configuration.git)
    [JTE] -- file path: pipeline-configuration/pipeline_config.groovy
    [JTE] Pipeline Configuration Modifications
    [JTE] Configurations Added:
    [JTE] - libraries.git set to [:]
    [JTE] - libraries.jenkins set to [:]
    [JTE] - libraries.utility set to [:]
    [JTE] - libraries.pod_template.cloud set to prod-ucp-ca--prod-devops-jenkinsagents-ns
    [JTE] - libraries.pod_template.build_agent.sdk.image set to maven:3.8.4-openjdk-11
    [JTE] - libraries.pod_template.build_agent.sdk.resource.cpu.request_mcore set to 1000
    [JTE] - libraries.pod_template.build_agent.sdk.resource.cpu.limit_mcore set to 2000
    [JTE] - libraries.pod_template.build_agent.sdk.resource.memory.request_mbyte set to 2000
    [JTE] - libraries.pod_template.build_agent.sdk.resource.memory.limit_mbyte set to 4000
    [JTE] - libraries.pod_template.build_agent.docker_build.enabled set to false
    [JTE] - keywords.development set to ^([Dd]evelop(ment|er|))|([Hh]otfix/.*)|([Ff]eature/.*)|([Pp][Rr]-.*)|([Rr]elease/.)|([Mm](aster|ain))$
    [JTE] - keywords.release_candidate set to ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-rc\.(0|[1-9]\d*))$
    [JTE] - keywords.release set to ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$
    [JTE] Configurations Deleted: None
    [JTE] Configurations Changed: None
    [JTE] Configurations Duplicated: None
    [JTE] Configurations Ignored: None
    [JTE] Subsequent May Merge:
    [JTE] - libraries
    [JTE] Subsequent May Override:
    [JTE] - libraries.pod_template.cloud
    [JTE] - libraries.pod_template.build_agent.sdk.image
    [JTE] - libraries.pod_template.build_agent.sdk.resource
    [JTE] - libraries.pod_template.build_agent.docker_build.enabled
    [JTE] Obtained Template Configuration File
    [JTE] -- scm: git ssh://[git@bitbucket.mydomain.com/CSMA/template_gradle_project.git](http://git@bitbucket.mydomain.com/CSMA/template_gradle_project.git)
    [JTE] -- file path: pipeline_config.groovy
    [JTE] Pipeline Configuration Modifications
    [JTE] Configurations Added:
    [JTE] - libraries.gradle.build.tasks set to clean build
    [JTE] - libraries.gradle.sonar.tasks set to jacocoTestReport sonarqube
    [JTE] - libraries.gradle.publish.snapshot.tasks set to snapshot artifactoryPublish artifactoryDeploy
    [JTE] - libraries.gradle.publish.release_candidate.tasks set to candidate artifactoryPublish artifactoryDeploy
    [JTE] - libraries.gradle.publish.release_candidate.properties set to -Prelease.useLastTag=true
    [JTE] - libraries.gradle.publish.release.tasks set to final artifactoryPublish artifactoryDeploy
    [JTE] - libraries.gradle.publish.release.properties set to -Prelease.useLastTag=true
    [JTE] - libraries.msteams.shouldNotify set to true
    [JTE] - libraries.msteams.channel.success set to https://mydomain.webhook.office.com/webhookb2/xxxxxx-1824-4578-a236-0da6fea05e6e@415bb08f-1a20-4fbe-9b57-313be7050945/JenkinsCI/12345fad6943f398ea00e456e477d9/9b697be3-1070-443c-be3d-cad096737c23
    [JTE] - libraries.msteams.channel.failure set to https://mydomain.webhook.office.com/webhookb2/xxxxxx-1824-4578-a236-0da6fea05e6e@415bb08f-1a20-4fbe-9b57-313be7050945/JenkinsCI/12345fad6943f398ea00e456e477d9/9b697be3-1070-443c-be3d-cad096737c23
    [JTE] - libraries.msteams.channel.unstable set to https://mydomain.webhook.office.com/webhookb2/xxxxxx-1824-4578-a236-0da6fea05e6e@415bb08f-1a20-4fbe-9b57-313be7050945/JenkinsCI/12345fad6943f398ea00e456e477d9/9b697be3-1070-443c-be3d-cad096737c23
    [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
    1 reply
    Below is the pull request build which has less libraries being loaded
    [JTE] Obtained Pipeline Configuration File
    [JTE] -- scm: git ssh://[git@bitbucket.mydomain.com/csma/jte-pipeline-configuration.git](http://git@bitbucket.mydomain.com/csma/jte-pipeline-configuration.git)
    [JTE] -- file path: pipeline-configuration/pipeline_config.groovy
    [JTE] Pipeline Configuration Modifications
    [JTE] Configurations Added:
    [JTE] - libraries.git set to [:]
    [JTE] - libraries.jenkins set to [:]
    [JTE] - libraries.utility set to [:]
    [JTE] - libraries.pod_template.cloud set to prod-ucp-ca--prod-devops-jenkinsagents-ns
    [JTE] - libraries.pod_template.build_agent.sdk.image set to [prod-dtr-ca.mydomain.com/devopstoolchain/maven:3.8.4-openjdk-11](http://prod-dtr-ca.mydomain.com/devopstoolchain/maven:3.8.4-openjdk-11)
    [JTE] - libraries.pod_template.build_agent.sdk.resource.cpu.request_mcore set to 1000
    [JTE] - libraries.pod_template.build_agent.sdk.resource.cpu.limit_mcore set to 2000
    [JTE] - libraries.pod_template.build_agent.sdk.resource.memory.request_mbyte set to 2000
    [JTE] - libraries.pod_template.build_agent.sdk.resource.memory.limit_mbyte set to 4000
    [JTE] - libraries.pod_template.build_agent.docker_build.enabled set to false
    [JTE] - keywords.development set to ^([Dd]evelop(ment|er|))|([Hh]otfix/.*)|([Ff]eature/.*)|([Pp][Rr]-.*)|([Rr]elease/.)|([Mm](aster|ain))$
    [JTE] - keywords.release_candidate set to ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-rc\.(0|[1-9]\d*))$
    [JTE] - keywords.release set to ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$
    [JTE] Configurations Deleted: None
    [JTE] Configurations Changed: None
    [JTE] Configurations Duplicated: None
    [JTE] Configurations Ignored: None
    [JTE] Subsequent May Merge:
    [JTE] - libraries
    [JTE] Subsequent May Override:
    [JTE] - libraries.pod_template.cloud
    [JTE] - libraries.pod_template.build_agent.sdk.image
    [JTE] - libraries.pod_template.build_agent.sdk.resource
    [JTE] - libraries.pod_template.build_agent.docker_build.enabled
    is there any issue between JTE and Bitbucket pull request build?
    Serpa
    @serpa-dystematic
    Hey @cokieffebah , I'm trying to setup the slaves on kubernetes but I'm wondering what image are you using for the jenkins slaves?
    I mean, the images would need to behave like slaves but have all dependencies installed. Are you creating an image that is FROM the jenkins/inbound-agent and then you install everything you need (docker specially to be able to run other containers)?
    If you're using any other strategy, could you share more details?
    4 replies
    Gregory Paciga
    @gpaciga
    I'm having an issue when JTE is combined with Bitbucket Branch Source plugin. It has worked fine with Bitbucket 6, but when switching to the Bitbucket 7 API, JTE seems to be unable to check out pull requests and instead tries to run the Jenkinsfile from the global JTE config. There is not an issue when running non-JTE pipelines, so the problem is either in JTE or in the interaction between the two. Any thoughts?
    6 replies
    ux123
    @ux123
    Hi all. Just a question regarding the Replay button on Jenkins. For our jobs that use JTE, we are not able to do a replay. According to https://github.com/boozallen/jenkins-templating-engine/blob/main/Version_2.adoc, version 2 fixes this issue but we are on version 2.3 and still have the problem. Anything we are missing?
    1 reply
    karthiknannapaneni
    @karthiknannapaneni
    @cokieffebah Can we use JTE and override the branch for a particular project.
    4 replies
    ValeriuMorari
    @ValeriuMorari

    Hello can anybody help to import class within ususal step

    example
    class is defined within class_definition.groovy

    package class_definition
    
    class Something implements Serializable{
        public String someAttr;
    
        def someMethod(){
            println("RUnning method")
        }
    }

    within other file name step_definition.groovy I am importing class and creating object

    import class_definition.Something
    
    void call()
    {
        Somthing obj = new Something()
        obj.someMethod()
    }

    Error sound like:
    [JTE] Failed to parse step text. Library: demo. Step: class_definition.
    [JTE] class org.codehaus.groovy.runtime.InvokerHelper$1 cannot be cast to class org.jenkinsci.plugins.workflow.cps.CpsScript (org.codehaus.groovy.runtime.InvokerHelper$1 is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @7894f09b; org.jenkinsci.plugins.workflow.cps.CpsScript is in unnamed module of loader jenkins.util.AntClassLoader @7d41bf50) (show)

    If I implement call function within class_definition.groovy I got some import errors

    5 replies
    jzr1991
    @jzr1991
    Hi, hoping someone may have seen this before because I'm at a loss! Im using JTE 2.3 and I've realized that every time a pipeline runs, i get a huge stacktrace of the same null pointer exception over and over, particularly around the time where JTE is doing its "Obtaining configuration from scm" etc. The NPE error is something like "EnvActionImpl.java getProperty null" and the stack trace has references to the JTE plugin source and is from calling the initializion method and TemplateFlow creation. Unfortunately i can't get a hold of the entire log output but has anyone seen anything like this?
    ARUN SHANKAR TIWARI
    @arunstiwari
    In what scenario, the configuration jte.pipeline_template is ignored?
    I have got a repo level pipeline_config.groovy file in which i have specified the name of jenkins template as jte { pipeline_template="commit_pipeline_template"}.
    ARUN SHANKAR TIWARI
    @arunstiwari
    At the global level i have got directory named pipeline_templates in which the file named commit_pipeline_template.groovy. But it is unable to select the template and the message in the log is [JTE] Configurations Ignored: jte.pipeline_template. Any help would be appreciated
    2 replies
    mdeitrick
    @mdeitrick
    @cokieffebah and all others to which this applies - is anyone running pipelines with a Jenkins Templating Engine definition on the CloudBees SDA CI platform?
    1 reply
    Serpa
    @serpa-dystematic
    Hey @cokieffebah is it possible to control the number of builds pulling the libs at the same time? Sometimes our master lags a lot (sometimes crashes) when too many builds start at the same time and it has to do that initial libs pull...
    2 replies
    Serpa
    @serpa-dystematic

    Hey guys. Regarding this issue: jenkinsci/templating-engine-plugin#225
    We are not able to upgrade our JTE because of that. We sometimes need to replay builds and cannot rely solely on the build now button.

    I have in my template:

    on_commit to: all_branches, {}

    In my pipeline_config.groovy:

    keywords{
      all_branches = /.*/
    }

    and I get this error when using the replay button:

    Started by user João Serpa
    Replayed #15
    [Pipeline] Start of Pipeline
    [Pipeline] End of Pipeline
    groovy.lang.MissingPropertyException: No such property: all_branches for class: org.boozallen.plugins.jte.init.primitives.TemplateBinding
        at groovy.lang.Binding.getVariable(Binding.java:63)
        at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:271)
        at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:353)
        at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:357)
        at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
        at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
        at WorkflowScript.run(WorkflowScript:3)

    I've checked that in the documentation you have the keywords prepended with a ~, but I've tried in both forms and get the same issue.
    Any help would be greatly appreciated!

    5 replies
    saicharan1906
    @saicharan1906
    hi @steven-terrana -- Trying to reference ${config.<var_name>} in single quotes [to avoid groovy string interpolation issue]. something like 'config_<var_name>'?
    1 reply
    this is regarding the parameterizing pipeline libraries
    tnam
    @tnam
    Hi, is there a way to dinamically load libraries by using job parameters?
    Sarath Addanki
    @asknet
    Hi @steven-terrana - May I know what is the best practice to pass data between libraries?