How to make the Jenkins build output as downloadable from Jenkins server machine itself? - jenkins

I am new to Jenkins. i have configured the Jenkins "Free Style" project and executing a power shell a script to get an executable application(Exe) as output. i have searched for some of the plugins to make the Jenkins output (exe) as downloadable from the Jenkins server machine itself as an artifact link(download link). But i found the Jenkins plugins to copy the archive files, upload to ftp and some other plugins.
So, Could anyone please suggest me is there any option or plugin available to make the each Jenkins build output file as downloadable from the Jenkins server machine by keeping it in a server machine some other place?

A simple option would be to copy the artifact to the userContent directory in Jenkins. This is found under $JENKINS_HOME.
Once artifact is there, you can have a static link to it in the form of
http://<jenkins-host>:<port>/userContent/<your-artifact.exe>
I hope this helps.

Related

How to attach build log files to Jenkins?

I'm building Jenkins pipeline and after pipeline fails with server installation some logs are generated on machine where server is being installed.
I want to attach those logs to Jenkins build so person can see that file from Jenkins build only instead of going to machine and find it out.
I saw a plugin Copy To Slave Plugin but for installation when I searched for it in Jenkins, it's not listed.
Could you please suggest which plugin will help me to attach log files to Jenkins build?
Due to the complex nature of filesystems, Jenkins is not capable to copy logs from extraneous locations like those outside of the Jenkins root directory. This is for security reasons, which is why the Copy to Slave Plugin you referred to earlier has been discontinued.
In short, Jenkins spawns processes that spawn other processes that are owned by different users in the filesystem (e.g. root). For this reason, it is highly probable that the log files you are referring to are located elsewhere on the file system (i.e. not in $JENKINS_HOME), and thus are not owned by the jenkins user.
It is possible to use cat or tail on the log files in the Jenkins build itself. In combination with a plugin like Log Parser, this can provide some nice output in another screen.
I would be interested about what do you mean by “install”? Can the install happen during the building of a Docker image? Or in a pre-built Docker container? If this is the case, you can copy the “installed” files to the destination.
This would help you, because any log files created during the “install” can be copied out from the docker container and attached to the Jenkins build as an archived artifact.
For this, you don’t even need a plug-in.

Update jenkins war on one machine and then move it to another one: possible?

I have a machine with blocked outgoing connections so it is not possible to update jenkins nor install the plugins I need for my work.
My idea is the following: I download the jenkins .war on my personal laptop and complete the installation + the plugin download.
Then I just move this .war to the machine where I need jenkins to be up and running.
Is it possible? Where are the plugins/updated data stored?
Also, would it be a problem the fact that my laptop has windows as os, while the destination machine is a linux RHEL?
Your solution sounds crazy :D
This could be help you:
Update Jenkins war
If you have shell access with root privilege, there is a manual way.
Download latest war file inside your linux, using wget , curl or just upload it using winscp from your windows.
Stop jenkins
Backup EVERYTHING: linux snapshot, jenkins workspace, jenkins war file, etc
Replace the old war with new war
Start jenkins
Detailed steps in this webs:
https://mohitgoyal.co/2017/02/15/upgrade-jenkins-server-to-a-new-version/
https://www.thegeekstuff.com/2016/06/upgrade-jenkins-and-plugins/
Plugin
Jenkins has an option to install plugins called Manage Plugins
This offer two options :
(1) Install plugins using available option
For official and compatible plugins, suggested by Jenkins :
(2) Install plugins using upload option
For custom plugins or when is not available on official repositories:

How to deploy delphi exe output to artifactory using jenkins

I use a script in Jenkins to build delphi projects and I want to deploy their .exe outputs to Artifactory server but I dont know how. Is there any plugin to deploy exe files to Artifactory?
Is it a good idea to deploy them to Artifactory?
The best would be using the Jenkins Artifactory plugin.
The plugin allows your build jobs to deploy artifacts automatically to Artifactory and have them linked to the build job that created them.
The support for generic (freestyle) builds is probably the most suitable one for deploying the .exe files. As part of the support for generic builds, you will be able to defined patterns for selecting which files would be deployed and to where.

Plugin to Copy Files from Desktop to Jobs Workspace in 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

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