calling perl scripts from jenkins

4,053 views
Skip to first unread message

Levin, Ilya

unread,
Oct 25, 2012, 8:05:34 AM10/25/12
to jenkins...@googlegroups.com

Hi,

 

Seems to be quite a simple task but still unable to achieve this.

How can I call a perl script from inside Jenkins?

 

Thanks

mitesh makhija

unread,
Oct 25, 2012, 8:11:38 AM10/25/12
to jenkins...@googlegroups.com
Hi,

Create a job.
Through build, add build step, you can use either Execute windows batch command or Execute Shell.
If I select Execute Windows Batch Command, In command I can call perl script.

perl c:/test.pl

Thanks,
Mitesh

Levin, Ilya

unread,
Oct 25, 2012, 8:19:46 AM10/25/12
to jenkins...@googlegroups.com

That is exactly what I did.

The problem is that Jenkins doesn’t recognize the perl command.

I have Perl on my machine, i can run the command via command line.

Somehow I need to show Jenkins where perl is.

(tried with Env Variables – doesn’t work).

 

Thanks again.

mitesh makhija

unread,
Oct 25, 2012, 8:29:45 AM10/25/12
to jenkins...@googlegroups.com
Hi,

Through windows cmd, I execute perl script like: perl test.pl
and export the installed perl binary in environment variable.

In perl script, we give our perl statements. if we are able to execute the perl script through cmd, we should able to do it through Jenkins also.

and we can also define the perl location in shebang statement also.

Thanks,

Mark Waite

unread,
Oct 25, 2012, 8:44:29 AM10/25/12
to jenkins...@googlegroups.com
Usually that means the environment in which Jenkins is executing does not know the path to the perl installation.

Create a job, assign it an action to echo %PATH% and then you can see the environment which Jenkins is running.



From: "Levin, Ilya" <ilya....@hp.com>
To: "jenkins...@googlegroups.com" <jenkins...@googlegroups.com>
Sent: Thursday, October 25, 2012 6:19 AM
Subject: RE: calling perl scripts from jenkins

Stanley, Jason

unread,
Oct 25, 2012, 9:40:19 AM10/25/12
to jenkins...@googlegroups.com

What user account do you have Jenkins running as?

 

If it’s running as “Local System” change it to an actual user account.

Reply all
Reply to author
Forward
0 new messages