Hi,
We are developing pipeline shared libraries to organize common tasks. Some
of the functionality involves deploying files to our binary repository.
We've decided to create small classes and methods to keep things simple and
maintainable. But we have some concerns about what the developer should
have access. Take the example below:
src/com/mycompany/Deployer.groovy:
package com.mycompany
class Deployer {
// I don't want the developer to call this method directly
def deploy(file) {
//
}
}
vars/myDeploy.groovy:
def call(file) {
checkFileContents(file)
checkPermissions()
// ... does a lot of things and then:
new com.mycompany.Deployer().deploy(file)
}
Jenkinsfile:
node() {
// Ok
myDeploy('file.bin')
// Should raise an exception
new com.mycomany.Deployer().deploy('file.bin')
}
We would like to restrict which methods can be directly called from the
Jenkinsfile.
Is there any way to implement such restriction?
Thanks,
Cristiano
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/abe5133d-0edf-44f0-8add-40b14200d6b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.