Publish over FTP issue - Jenkins - jenkins

I have been struggling to get the Publish over FTP to successfully transfer my DotNetCore build artifact from my Jenkins Linux slave to my AzurePack server. This plugin worked for the same host and target server in the conventional Jenkins pipeline.
I would like to know why it is saying the transfer was successful when 0 files were transferred?
I would also like to know why it is not transferring any files when I am listing the source directory before and after the ftpPublish call and all of the files are being listed?
I would also like to know what should be in the paramPublish variable?
Below is my groovy code:
Publish over FTP stage in JPaC
Below is my console output from Jenkins:
Jenkins Console Output

Related

How to automatically copy artefacts from Jenkins job into given network drive?

I'd like the files generated by Jenkins script to be automatically copied into a given directory on the local network.
Is there a plugin or script for doing that ?
In my case it worked by using SCP in a build step "Execute shell". The remote server needs to be accessible via ssh.
If your artifacts are the result of a maven build, maybe a Nexus Repository Manager is what you are looking for. A simple mvn deploy would do the job.

How to fix "ENOENT: no such file or directory" when downloading artifact from jenkins

I'm trying to run automated tests with AppCenter. For this, I need to get the apk from Jenkins and the ipa from another Jenkins in a TFS Build to send them to AppCenter. I'm using the "Jenkins Download Artifact" task in TFS. For the apk, everything works fine.
But for the ipa, TFS see all the artifact from the last build, select the one that match the name pattern but whenever the download begin, the build fail and throw instantly a Error
[error]Unhandled: ENOENT: no such file or directory, open 'C:\Agt1_work\308\s\jenkinsArtifacts\delivery\APPNAME-calabash-5.22-build-1557912880-date-20190515-11:34:40.ipa'
The login used has all right on the Jenkins, and if I go manually on the Jenkins the download is working.
On the Jenkins on the url I can manually download artifacts
http://IPADDRESS:8080/job/JOBNAME/lastSuccessfulBuild/artifact/delivery/
Is the TFS task, the Job Name is the Job Name in the url
the rest of the task configuration :
And the Endpoint configuration :
It shouldn't matter but note that the Jenkins is on a computer in a internal network so I use the IP address in the url.
with this configuration when I build (with System.Debug at true) I have this Error
I don't have a direct access to the computer where the jenkins is. So I don't know the exact configuration of the jenkins.

Push build from Jenkins to Amazon EC2 using Msdeploy.exe

I have a Jenkins job that successfully builds my project, now i am trying to push the build to remote Amazon EC2 server using the MsDeploy command as follows:
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -allowUntrusted -source:contentPath="%WORKSPACE%\dist" -dest:auto,computerName="https://ec2-xx-xxx-xx-xxx.compute-1.amazonaws.com:8172/MSDeploy.axd?site=Default Web Site",username="administrator",password="xxxxxxxxxxx",authtype="Basic",includeAcls="False"
This command is working from my local machine command prompt as well as from the Jenkins server command prompt but giving ERROR_USER_UNAUTHORIZED when ran as a Execute windows batch command build step from Jenkins Job. Below are the error details:
When i copy the password from the above formatted Msdeploy command from the Jenkins console output and try to remote into the respective server, it doesn't log me in. Whereas if i copy the password from else where say like notepad, word etc.. and try to remote into the server, its working. It looks like the problem is with the way Jenkins is formatting the Msdeploy command. Should i have to format it in a specific way or is there any specific order the arguments in the command has to be framed ?
I know there are other options like using the publish over ssh plugin in Jenkins, but wondering why it can't be achieved with a simple Msdeploy command.

How to send build artifacts over ssh using Jenkins pipeline

I was using Freestyle project method for configuring jobs in Jenkins. I have used Publish Over SSH plugin to send war file to remote system. Now i moved to pipeline configuration. I would like to know how can i do the same in pipeline configuration. Can anyone tell how to write pipeline script for publish over ssh?
Any help would be greatly appreciated.
You can use the raw Unix command scp, as described there : Example syntax for SCP. scp is Unix utility for secure copy... over SSH, which is exactly what Publish Over SSH uses behind the scenes !
Example :
scp your_username#remotehost.edu:foobar.txt /some/local/directory

How to copy file from remote host to jenkins server

I am using jenkins for build process. I am running some scripts on remote server using jenkins server. It's fine but remote host generates some html file. I want to copy that file back to jenkins server. Is it possible to do it from jenkins server?
If you want to archive it permanently, you can use the Archive Artifacts option in the Post-build step in Jenkins. In the case of builds that happen on slaves, Archive Artifacts copies the artifacts back to the Jenkins server for archiving and reuse.
If you want to then use this in a subsequent build, you can use the Copy Artifacts step to introduce an artifact from another build into your subsequent process on any Jenkins slave.
We use this to move production builds into our test environment after packaging and it works great.
Copy to slave plugin also copies files back from slaves to the master. Might be worth the look.

Resources