wcm-io-devops / jenkins-pipeline-library Goto Github PK
View Code? Open in Web Editor NEWwcm.io Jenkins Pipeline Library for CI/CD
License: Apache License 2.0
wcm.io Jenkins Pipeline Library for CI/CD
License: Apache License 2.0
When running the jenkins-pipeline-library with the newest Jenkins (2.387.1) execMaven throws an error:
java.lang.IllegalAccessError: class io.wcm.devops.jenkins.pipeline.managedfiles.ManagedFile tried to access private field io.wcm.devops.jenkins.pipeline.model.PatternMatchable.id (io.wcm.devops.jenkins.pipeline.managedfiles.ManagedFile and io.wcm.devops.jenkins.pipeline.model.PatternMatchable are in unnamed module of loader org.jenkinsci.plugins.workflow.cps.CpsGroovyShell$CleanGroovyClassLoader @f16bbba)
Looking at the respective classes Line 38 in src/io/wcm/devops/jenkins/pipeline/managedfiles/ManagedFile.groovy one can see that this.id = id
is applied, after the super call to PatternMatchable
. Looking inside that class under src/io/wcm/devops/jenkins/pipeline/model/PatternMatchable.groovy one can also see that inside the constructor the id is already set. The call inside the ManageFile class is therefore redunant.
Removing it from there will still lead to the id being set and therefore not break anything.
is it possible to define enum in library and use its value as a function parameter?
where enum should be located in src
or vars
?
it's possible use the jenkins-pipeline-library/src/io/wcm/devops/jenkins/pipeline/scm/GitRepository.groovy
to fetch a branch into workspace ?
Can you post an example ?
Would like to see a findFIlesCallback implemented in the LibraryIntegrationTestBase to allow returning of all files that match a pattern provided.
Example searches:
helper.registerAllowedMethod(FIND_FILES, [LinkedHashMap.class], findFilesCallback)
...
def findFilesCallback = {
Map config ->
// TODO:
}
Was reviewing the locateTestResource for a possible existing workaround but doesn't account for the fuzzy searches only exact file names. Initially tried
File file = this.dslMock.locateTestResource(config["glob"].toString())
But is when discovered the fuzzy search did not work. I do like being able to drop all resources in the /test/resources folder for any of the searches so would like the findFiles to follow that pattern.
When setting up the library on a blank jenkins with the latest plugin versions, it's not possible to build as the script uses "illegal" methods which are rejected by the sandbox.
A quick win solution is to install the Permissive Script Security Plugin
(i know what I'm doing...), but this will remove the complete security layer provided by the sandbox.
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new io.wcm.devops.jenkins.pipeline.utils.logging.Logger java.lang.Object
at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectNew(StaticWhitelist.java:184)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onNewInstance(SandboxInterceptor.java:170)
at org.kohsuke.groovy.sandbox.impl.Checker$3.call(Checker.java:197)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedConstructor(Checker.java:202)
at org.kohsuke.groovy.sandbox.impl.Checker$checkedConstructor$3.callStatic(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214)
at io.wcm.devops.jenkins.pipeline.utils.maps.MapUtils.<clinit>(MapUtils.groovy:35)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.