Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have a shared library for a project specific Jenkins Setup.
One of my files in
vars/gradle.groovy
looks as follows:
* simple wrapper around the ./gradlew command in a repository.
* @param command : the gradle command that will be executed.
* @return nothing, except for status codes.
void call(String command) {
sh "./gradlew ${command}"
return this
When I try to call it from my actual project code (declarative Jenkinsfile)
like this:
stage('Gradle Build + Docker Build (against remote DB)') {
steps {
gradle "-PtestEnv=stage --continue build"
I get the following error:
WorkflowScript: 97: Step does not take a single required parameter - use named parameters instead @ line 97, column 17.
gradle "-PtestEnv=stage --continue build"
Any ideas what I'm doing wrong? Other functions use named parameters, and they work out of the box.
But in this case I would prefer a simple String
parameter to make the interface of the method as convenient as possible.
Thanks!
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.