Solved

jenkins parameterised shell script

Posted on 2013-05-23
3
3,744 Views
Last Modified: 2013-06-01
I want to execute shell script not shell command as:-
<Script name> [branches] [releaseName] [buildName]

How can I execute this shell scripts with parameter on jenkins?
0
Comment
Question by:jgdvishnu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Expert Comment

by:worm-getter
ID: 39193786
maybe this link might help you:

https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

good luck.
0
 

Accepted Solution

by:
jgdvishnu earned 0 total points
ID: 39199866
2 issues was faced:-
 a) where to put the shell script file on the jenkins server and how will Jenkins refer to that file

b) how will Jenkins server know that the given text is shell script and not a shell command.

Passing parameterized commands and parameterized flie using the below link was not helpful as user has to type in values manually and there are lot of chances that end user may enter incorrect or bizarre values and would need validations.
https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

Best approach was to enter below command in the Execute shell command text area -

exec <Script name>  [branches] [releaseName] [buildName]

Open in new window

some how the parameter got passed by the above suggested method by: "worm-getter" and it might be a way to pass input parameter however it is not recommended as it is error prone and also the uploaded shell file script file got uploaded successfully when prompted to run the job and got downloaded on running the job however they did not execute so I do not recommend that approach.
0
 

Author Closing Comment

by:jgdvishnu
ID: 39212596
This was tried and tested and we got good results.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question