How to pull parameters from excel sheet and pass it to job

55 views
Skip to first unread message

Devops-warrior

unread,
Jul 1, 2020, 3:44:59 PM7/1/20
to Jenkins Users
I have a job which will deploy web, app and DB servers into AWS cloud. As of now we are taking Ip's for each server from Network team and passing manually in build paremeters. Can someone help me? how to pull parameters from excel sheet and pass it on to jenkins job.

Slide

unread,
Jul 1, 2020, 3:56:54 PM7/1/20
to Jenkins User Mailing List
I don't think there is a way to do this right now.  https://plugins.jenkins.io/ui/search?query=excel

You may need to do something in a shared library or something similar.

On Wed, Jul 1, 2020 at 12:45 PM Devops-warrior <awscl...@gmail.com> wrote:
I have a job which will deploy web, app and DB servers into AWS cloud. As of now we are taking Ip's for each server from Network team and passing manually in build paremeters. Can someone help me? how to pull parameters from excel sheet and pass it on to jenkins job.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/73b11319-7504-4539-9758-4f1100e79236o%40googlegroups.com.


--

Ivan Fernandez Calvo

unread,
Jul 2, 2020, 1:17:58 PM7/2/20
to Jenkins Users
you can pass a CSV file as a parameter or download it from a bucket or something and you can read it with https://www.jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#readcsv-read-content-from-a-csv-file-in-the-workspace so if you convert that excel file to CSV you could read it.

David Riemens

unread,
Jul 15, 2020, 3:17:04 PM7/15/20
to jenkins...@googlegroups.com

Is XLS a requirement?

If not too difficult you could go for a simpler format (INI ?) that you could parse using some relatively simple Groovy code ?

Slide

unread,
Jul 15, 2020, 4:00:48 PM7/15/20
to Jenkins User Mailing List
Also, can you show how you would want something like this to work?



--

Braj Mohan

unread,
Jul 16, 2020, 5:27:05 AM7/16/20
to jenkins...@googlegroups.com
Hi All, You can pull the parameter from excel using shell script below is the code please check here i am using a google spreadsheet and fetch the particular field, you can fetch multiple fields also

#URL=https://docs.google.com/spreadsheets/d/e/2PACX-1vTSkSdNFjtRjZGzsf5NO3TJdaMeBNTYplU8EdN0iXUQXFMVIsdmf9N0g6X1eUYFpchxhE4/pub?output=txt

#URL=https://docs.google.com/spreadsheets/d/e/2PACX-1vTSkSdNFjtRjwYt7wpjZGzsf5NO3TJYplU8EdN0iXUQXFMVIsdmf9N0g6X1eUYFpchxhE4/pub?output=txt

RESULT=$(wget --no-check-certificate -q -O - $URL | sed '1 d' | cut -f7 )
echo ${RESULT} >/var/lib/jenkins/workspace/output/FrameWork.txt


RESULT1=$(wget --no-check-certificate -q -O - 'https://docs.google.com/spreadsheets/d/e/2PACX-1vTn0s1SuFDDo6M2C1Ey_hrP9rxlb-Uap2ciD77GZdvjZeWzf_mk0fPrHgVa0W5EYM/pub?gid=1140914179&output=txt' | sed '1 d' | cut -f7 )
echo ${RESULT1} >/var/lib/jenkins/workspace/output/output.txt

hope this will work for you

Thanks

B.M. Wadia


Reply all
Reply to author
Forward
0 new messages