2

I want to configure a parametrized job in jenkins, who manipulate file:

 parameters([ file(defaultValue: 'DEFAULT', name : 'tomcatCodesUrl' , description: 'URL of service where to find tomcat mapping json file'), 

the issus is , this parameter only return the name of the file. how can I acces to this content?

3 Answers 3

1

Currently there is no easy way to do this. You can find discussion about this in JENKINS-27413

Sign up to request clarification or add additional context in comments.

Comments

0

Yeah that parameter is as redundant as it can be. Might aswell just use string.

Anyway. You can get the files content with readFile:

def content = readFile encoding: 'utf-8', file: 'tomcatCodesUrl' 

1 Comment

I want to be able to upload a file, this will not work.
0

How to use file parameter in jenkins

This post might be helpful. The upshot is, when users upload a file, it will be saved into the root directory of the project's workspace. You can directly access the file using any programming language you like, given the file name. The file content is not returned to you as a parameter, but anyway, since you know its saved place (workspace dir) and file name, you are in control.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.