Welcome! Check out the docs: https://jenkinsci.github.io/templating-engine-plugin
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
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
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)
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)
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.
@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!
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()
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.
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
@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}'''
}
[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
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
allow_scm_jenkinsfile = true
option only works for scripted Jenkinsfiles..Thank you
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?
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
[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
FROM
the jenkins/inbound-agent
and then you install everything you need (docker specially to be able to run other containers)?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
jte { pipeline_template="commit_pipeline_template"}
.
[JTE] Configurations Ignored: jte.pipeline_template
. Any help would be appreciated
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!