?
Solved

jenkins parameterised shell script

Posted on 2013-05-23
3
Medium Priority
?
4,161 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

752 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