Is it possible to merge changes on server using Jenkins - jenkins

I am looking for a way to merge full local directory to a remote server using jenkins. It is easy to use some FTP plugin to delete while remote directory and re-upload all the files, but i would like to only upload new/changed files and remove the deleted files.
Is it possible to do that using jenkins? Maybe some other automation tool?

On Unix or Linux you can run 'rsync' with the two directories as parameters -
either on the local or on the remote host.
Just make sure you are not in the middle of some other operation while 'rsync' runs.

Related

How to build a jenkins pipeline choosing 4 path options to copy .war files to a selected tomcat's webapps folder?

I am new on jenkins and I have this situation here. Devs used to deploy by themselves .war files to various paths using a type of manual versioning.
I put my server with NFS share with those repository of files and I would like to build a pipeline choosing different paths to deploy files in my tomcat server.
If a Dev do a new version I just update this new path. But I need to do it selecting pre inserted paths as a choice. I need to deploy those new files selecting paths in a parameterized pipeline.
So I can do deploys just choosing a selection of paths to same tomcat server.
It is hard to start it. I configured my Jenkins docker container and it can execute remote test jobs well.
I need to write this type of pipeline and I really got some problems to join all pieces together.
Or if it is possible I just pass the NFS absolute path to this job as a parameter when I start to execute this pipeline to make it very flexible.
How can I start? I installed some plugins like File Operations and Send Files and execute ssh commands over SSH but it is hard to build it.
Any help or way or links to study it is appreciated.

I want to backup existing files in FTP every time before deploy, can this be done using Jenkins pipeline

I have a MVC web applications project we use FTP(Filezilla) to host. In Jenkins i know we have plugin to Deploy files to FTP but every time before that i want to backup existing files in FTP, can this be done using Jenkins pipeline. I am Sorry if I am not clear.
Yes, you should be able to use the Publish Over FTP plugin for this. You can use something like curl to download the files from the FTP.
curl -O ftp://server/path/to/file
Another option is SSH2 Easy plugin which allows FTP file upload/download.

How to specify the folder on remote machine for backup usinf thinBackup plugin of jenkins?

I want to take the backup of jenkins confuguration in case if I lode my machine. I am using the thinBackup plugin provided by jenkins. It has an option where I provide the path to folder where I want to take the backup.
Now the problem is I want to specify the folder on another machine, as it makes sense to have backup on different machine, how do I specifythe path to that folder? Do I have to specify as if
abc#12.34.567.890:path/to/folder?
I am new to jenkins so any help would be appreciated.
Thin backup performs just copies of jenkins configuration files in a specific folder for convenience. Is up to you to store it to scm or other machines, but it can be done with some simple script that upload your backup zip if exists

Download files over FTP in a jenkins job?

It seems that its only possible to upload files over FTP using:
https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+FTP+Plugin
But I need to download a file over FTP, I could write a groovy plugin for this but it seems strange that there is no plugin for this
Maybe the reason is that it is somewhat trivial to download a file during a build using a one-liner like:
curl -O ftp://server/path/to/file
The curl tool is available for just about any operating system.
If you only need to download one file over FTP and do not need to check out any other files, you could also use the URL SCM plugin.
There is now an SSH2Easy plugin available that supports sftp to/from remote systems. My company has moved to requiring use of sftp and won't allow ftp any longer.
This plugin, at the time of this reply, still needs some polishing, but it does work.

Is it possible to import file from local machine to Jenkins server during start of the build

Currently I have my whole automation source code (Script and test data) in Jenkins server and whenever I want to change my test data, I need to go to the Jenkins server machine and changing it .
The problem is if I want to change the test data, I need to wait for long time for my access from the admin team. Also I have huge number of test data in my project so I am not interested in creating Jenkins project with Parameter Builds. So if there any option available in Jenkins to import files (excel) before build then that would we helpful.
Please consider as a priority one.
The most common way to transfer files to Jenkins server is to use a version control system like git or subversion:
Commit files to version control system
Configure Jenkins job to detect change in the version control system and check out work directory for the build or test
If your files are so big they cannot fit into a version control system (some of them do not perform well with files in the gigabyte range), you could use a shared disk drive which you have permission to write to.

Resources