Reputation: 2343
I need to store a .csv or .txt file and access it from the Jenkinsfile. I currently have couple of files which are in the credential storage (logins, passwords and so on) but this file just has to be stored on the Jenkins machine. I know I could upload it directly to the node but I would prefer doing it in the similar fashion as with the credentials (using web interface).
Upvotes: 0
Views: 1206
Reputation: 11940
You can save the file in Managed Files through the web interface: Manage Jenkins > Managed files > Add a new Config.
Each file saved there will have an auto generated ID or you can set your own id, next you can use Config File Provider Plugin to access your files through Jenkins Pipeline using the file ID like this:
configFileProvider([configFile(fileId: 'maven-settings', targetLocation: '/path/to/file/in/workspace')]) {}
Upvotes: 2