Jenkins setup:
Podman Container Setup for Testing purposes,
- Current Version of Jenkins Container
- Agent: Ubuntu node with java 17
Hi,
Im just starting with Jenkins und Testing it for my Usecase. Currently im running into an issue, im not able to resolve.
I get the following error when running the following groovy code:
java.io.FileNotFoundException: /home/jenkins/agent/workspace/tompia_system/.conf/config.json (No such file or directory)
faulty Method:
import groovy.json.JsonSlurper
def call() {
def inputFile = new File("${WORKSPACE}/.conf/config.json")
def jsonText = inputFile.text
def InputJSON = JsonSlurper.parseText(jsonText)
def branch = env.BRANCH_NAME
return InputJSON << InputJSON.targets."$branch";
}
Path is correct. Works fine on the console with the same user. The part that crashes is parsing with inputFile.text.