0
votes

I want to upload files with Jenkins using File Parameter, from my loacal PC, from anywhere except the project workspace and send it vi FTP(with put). The following problem appears:when the file uploaded is anywhere on my PC except the project workspace ,the name is changed in "file location"(which in my case is "file" see the screenshot), from File Parameter. How to obtain the browse path in this scenario in order to have the correct path to file name (/browse/path/to/the/file/$file) respective the original name. If there is another method,plugin in Jenkins to upload any file from PC please let me know. Thank you! The bash code is:

#!C:\cygwin64\bin\bash.exe
export PATH=$PATH:/usr/bin

for (( c=0; c<$NumberOFjobs; c++)) ;do

USER=usser           
PASS=pass

ftp -inv $IP <<EOF
user $USER $PASS
cd /D:/builds2
put $file
bye
EOF
ls -l
done
exit 0

FileParameterscreen If I use:"put file" works "correctly" except the original file name is changed. If I use:"put $file" which give the original file name, the "File not found" error occurred.

1

1 Answers

2
votes

The answer to my problem is:

mv file ${file}.

I found it here: Jenkins Parameterized Build upload file and save original file name