Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

readYaml method is not available for Jenkins

When I call readYaml() in jenkins pipeline I get an error that such method is not available.

def parameters = readYaml(file: "public/symfony/app/config/parameters.yml.dist")

Error:

java.lang.NoSuchMethodError: No such DSL method 'readYaml' found among steps [...]

Jenkins version is 2.46.2.

I suspect the reason is Jenkins version and I need to upgrade to latest. Before I do that I would like to know if there is something else to try to solve this. I would prefer not upgrading since there are other important jobs that run there.

like image 550
raitisd Avatar asked Sep 06 '17 15:09

raitisd


1 Answers

You need to install the pipeline utility steps plugin to use that function.

You can install it via the Jenkins plugin manager.

If you are running jenkins inside a container, you could also simply adjust the official image:

FROM jenkins/jenkins:2.46.2

RUN /usr/local/bin/install-plugins.sh pipeline-utility-steps
like image 150
fishi0x01 Avatar answered Nov 19 '22 06:11

fishi0x01