I have JS file in my project with config:
export default {
key: "water",
title: "Shop",
icon: "shop-icon",
};
I need get (inside Jenkins script pipeline) key
value: water
.
I can doing this by readFile
function: Jenkins Read a Specific Line of a File in Jenkinsfile with Groovy and use split
method.
But I want to ask: is there any other solution to read value from JS file?