How to download files from remote windows share in jenkins? - windows

I am using Publish Over CIFS plugin in Jenkins to transfer the files over to remote windows share folder.
But, it seems like there is no option available in this plugin to download files from remote windows share to local.
Is there any jenkins plugin can achieve this?
Is the the "File Operations Plugin"'s fileDownloadOperation support downloading from a windows share folder?
Thanks.

The File Operations Plugin does work with network shares. Just use the fileCopyOperation and give the path to your share like this: \\ShareServer\ShareName\path\to\your\file

Related

Copy the files from Linux vm to azure repository

I don't know if it's possible or not.
I have one Linux vm where we have some files. we don't have any git installed inside the Linux vm, in other hand we have azure repository.
Using azure pipeline job, we have copy all the files from Linux vm to azure repository and start the build, if the build is successful then we have to merge the copied code into azure repo.
Please let me if it's possible

How to extract and export artifact files (SNAPSHOT.jar) from Jenkins to a network drive

My team has code being built and tested in Jenkins and when the build process is done Jenkins produces a SNAPSHOT.jar file. I need to unpacked the snapshot.jar file and send the extracted files and folders to a network drive. What is the best way to do that?
I've tried a few Jenkins plugins, the most recent being artifactDeployer, but when the plugins deploy the artifacts, as a post-build action, they don't unpack the jar files; I would have to execute a windows batch command after they are deployed to unpack them but I cant because the plugin runs as a "post-build action" and the batch commands are done before the post-build actions. Is there a way to deploy the artifacts and unpack them without using a plugin? Or is there a plugin that will do both? What is the best way to achieve this?
The way I accomplished this was by using 7zip in a Windows batch command as a post-step in the jenkins project configuration.
The command is:
`7z x %WORKSPACE%\target\*.jar -oX:\"mapped network drive location" -y`
This extracts the artifacts out of the snapshot.jar file and places those artifacts into the network drive. I needed the files contained in the snapshot.jar to be sent to the network drive when the build completed. I am new to jenkins and the plugins I tried were post-build actions and only copied the snapshot.jar to a given location; they did not extract the artifacts out of the jar file. That is why I chose this route.

Copying files between two windows servers through jenkins

I am working on a project where i want to copy the compiled file (which compiled through jenkins) from one windows server to another through jenkins. Jenkins is installed on a windows server and after building the code, those compiled file should be copied to another windows server through jenkins. Is there any way to achive it?
Jenkins might be able to do it, via the script steps running the scp command; however, if this is part of a build, I would suggest attaching the file(s) to a project, and distributing them through the maven repository.

How to create directory on remote server using Maven

I use maven for copy files to remote servers but if the folder doesn't exist the command fails. Any help?
You can take a look at the sshexec-maven-plugin which does what you like. But this sounds like you are on the wrong road, cause Maven is a built tool not a deployment tool. For those purposes i would suggest puppet or chef etc.

How can I copy the artifacts from Teamcity to another server?

how can I copy the artifacts from Teamcity to another server?
Thanks
The way I have done this, make things a lot easier.. Setup another configuration that pulls in, via artifact dependencies, all the files you need then run a cmd script to xcopy/copy the files to another drive on the network. You can do this using cmd script, vbs, python, shell etc..
Remember, you only need to refer to directories as if they were local as you would have your script in the same working directory
i.e cmd script :: xcopy .\"my build artifact(s)" \path\to\drive\on\my\network\"my build artifacts"
It doesn't get easier than that.
Naturally, if your artifacts are huge, then you may want to consider your more complicated option. However, TeamCity currently have a ticket pending, which you can vote on, that allows you to run multiple runners in one configuration - so you could just add your cmd script to the same configuration to save the copy time; please vote if can spare a minute:
http://youtrack.jetbrains.net/issue/TW-3660
There is a Deployer plugin, that supports deploy by fileshare/SMB, FTP, SSH and other means. The usage is basically the same as the Artifact paths.
We have used just samba, so you must enter:
target Host path: //server/drive/myfolder
Username: mydomain\myusername - in our case we had to write domain
here too
Password: ****
Domain: mydomain
and in path just select the files as in artifacts:
product/* => product.zip
and it will create file //server/drive/myfolder/product.zip
You can do it from your build script or externally.
If you are looking to get artifacts copied from a remote build agent to the primary TeamCity server, you may want to look into configuring Build Artifacts under the General Settings.
According to TeamCity's wiki entry on BuildArtifacts (http://confluence.jetbrains.com/display/TCD7/Build+Artifact) "Upon build finish, TeamCity searches for artifacts in the build's checkout directory according to the specified artifact patterns. Matching files are then uploaded ("published") to the TeamCity server, where they become available for download through the web UI or can be used in other builds using artifact dependencies."

Resources