Plugin to Copy Files from Desktop to Jobs Workspace in Jenkins - jenkins

I have a scenario wherein the users who have created some configuration files need to upload the same from the desktop where they access Jenkins onto the Job's workspace to build and execute tests.
So I did try using the Config File Provider plugin as mentioned in https://wiki.jenkins-ci.org/display/JENKINS/Config+File+Provider+Plugin. This seems to work fine to copy the configuration file to the Jenkins UI, which can be later synced to the Slave with the given path in the Build environment of the respective job. But the users who wish to upload these files don't have the administrative rights. Hence they are unable to access the Configuration File Management which is under the Manage Jenkins tab. Is there any way that I can move the Configuration File Management under the Jenkins sidebar and allow users to edit the same.
Are there any other plugins that will help me achieve the same? I did also try Copy to Slave plugin but this only copies the files under $JENKINS_HOME/userContent to the job's workspace. We will have to copy the files from the desktop to $JENKINS_HOME/userContent and then use the plugin.

Wouldn't using a parameterized job and have one of the parameters be a File Parameter? See https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

Related

TFS - Build and Release, configuration file provider

Is there any similar plugin like this
https://wiki.jenkins.io/display/JENKINS/Config+File+Provider+Plugin
in TFS Build & Release
I want to provide configuration.json file which is not included in git source.
Unfortunately, there is no such extension in TFS/VSTS Build & Release.
According to your tag tfs2013, seems you are working with XAML build.
Just like you need a workspace on your dev machine to develop your app, you must specify the workspace that the build agent uses to build and test your app. Then we get/pull source files from TFS server side. It's not able to achieve below similar features in TFS UI:
Adds the ability to provide configuration files (i.e., settings.xml
for maven, XML, groovy, custom files, etc.) loaded through the Jenkins
UI which will be copied to the job's workspace.
As a workaround, you could try to put configuration.json files in a ftp server instead of git source and then use a PowerShell solution to down the files in build agent workspace. If create a PowerShell to over FTP you can have it called by the build template(customize workflow).

Export file generated by a project

I have a Java project that is running as a job on a Jenkins server. The project is generating a file that is being stored locally on the server in the respective project folder. Currently, to get hold of this file, I am logging into the Jenkins server and get it manually. I would like to make this file available for download directly through the Jenkins job somehow. Not sure if there is a way to do that though. Is there a plug in that might add this functionality or is there any other way to achieve that?
Archive the file. For a freestyle job, that would be a "Post Build Step". For a pipeline job, use archiveArtifacts.
You definitely don't want to rely it on it being in a workspace on the Jenkins agent machine somewhere. The workspace directories can move and change, or be removed.

Jenkins ArtifactDeployer simple creates a new dir in base dir?

I am in Jenkins and using ArtifactDeployer. The console output tells me that the remote repo is http:// myrepo but all it does is create a new folder in my base directory which I also specify in this plugin. It correctly finds only one file to copy but strangely just creates a new directory and copies it in there. I thought this would enable me to deploy artifacts to another server... Can I do that?
No you can not do that with artifacts deployer but there are other ones you can use - read below:
Jenkins provides by default a feature for archiving artifacts generated by the build of a Jenkins Job. These artifacts are archived in the JENKINS_HOME directory. However, this directory contains also tool configurations (global and job configurations). Therefore, there is no separation between infrastructure data, jobs data and generated elements. It is often considered to be a bad practice and it doesn't help to manage it from an administrator point of view.
Unfortunately, it's not possible to extend the 'archived artifacts' feature to archive artifacts in a location other than JENKINS_HOME.
The main goal of the ArtifactDeployer plugin is to archive artifacts in your desired locations (other than JENKINS_HOME directory).
There are many Jenkins plugins close to ArtifactDeployer such as CopyArtifact plugin or CopyArchiver plugin for publishing artifacts from Jenkins resources (from the current workspace, from the old builds of the same job or other jobs, ...) to remote locations with the protocol file://
There are also others plugins for managing other protocols such as ftp://, ssh:///.

Jenkins userContent files

We have a Jenkins master-slave model. Each job that is being run on slaves require a certain amount of configuration files. These files must be copied from master to each slave before the build step. So far I have been able to accomplish this with the Config File Provider Plugin. The drawback of this plugin is that it doesn't support folders, I would like to be able to put the configuration files for slave1 in the folder slave1 and so on. Now I have a huge list of files in the dropdown menu when creating a job and asked to provide configuration files.
This plugin comes with something handy: the configuration files can be edited via the web interface.
On the other hand Jenkins provides a userContent folder on the master accessible via http://[jenkins-server]/userContent that resolves my need for folders, but I haven't found a way to edit these files from the provided web interface.
I must mention that the master is a remote machine and I don't want to connect to it everytime I need to modify a file there. Is there any way to edit the files in the userContent folder, or to organize the files uploaded to the Config File Plugin into folders?
Thanks!
If possible put all the configuration into your SCM system and allow Jenkins to fetch them when needed/as they change.
Then your configuration files are managed just like your source code. As a bonus you can add a new node easily and developers can access and use they configuration files to test their build.
Supporting evidence:
Martin Fowler
Andrew Binstock
Darryl Bowler
If you have environment specific config files you can either load all of the individual config files into into your SCM system (this becomes unmanageable if you have a lot). Alternatively you can still store them in your SCM system and then do some combination of scripting with Jenkins parameters to update them on the fly.

Cloud I access builds directory from Jenkins/Hudson?

I use Jenkins to run Clover, I can see the HTML report on Jenkins' web GUI, but I also want to download clover.pdf. It's created under workspace directory (only newest version) and builds directory like Jenkins\jobs\Job_test\builds\2013-02-19_17-12-25.
Is there any solution to access Jenkins\jobs\Job_test\builds\2013-02-19_17-12-25 from web ?
Archive the artifact that you require. All the archived artifacts will be stored in Jenkins server and can be accessed from web.
The link to the artifact will look like below
/jenkins/view/Test/job/jobname/lastSuccessfulBuild/artifact/path/to/mypdf.pdf
This can be achieved though the post build step "archive the artifacts":

Resources