Scripting language to learn

41 views
Skip to first unread message

bms5...@gmail.com

unread,
Dec 26, 2014, 9:36:26 PM12/26/14
to jenkins...@googlegroups.com
Hi,

I currently use Jenkins at my workplace for automated builds. My job title is Build Manager, so I do daily baselines/releases. I have just started using bash scripts for creating released files. I would like to learn it more in depth. Does anyone have any online tutorials or books that are helpful in bash scripting? I'd also like to learn a general purpose scripting language that might come in handy. I notice that most jobs out there have listed Python, Perl, and Ruby. Is there one that anyone would recommend? Python looks easy to learn out of the three, but I was wondering if there was a common language used in configuration management or another scripting language that would come in handy with Jenkins. Thanks in advance.

-Bill

Les Mikesell

unread,
Dec 26, 2014, 11:07:57 PM12/26/14
to jenkinsci-users
As far as learning bash goes, it is not so much a matter of learning
the syntax itself so much as understanding all the other separate
executables and unix tools that you can orchestrate within a script.
For other languages, perl has a big advantage in terms of the huge
library of high-level libraries/modules available in CPAN - pretty
much everything you would want to do has already been done and is
available there, greatly reducing the amount of new code you have to
write yourself.

In the context of jenkins or if any of your builds are java-related
you might want to look at groovy. It has the disadvantage as a
command line tool of having to start up a jvm, but as a tradeoff, you
can 'import' any compiled java jar files and call their methods - or
inside of a jenkins job the groovy plugin can access most of its
internals. It is easier to understand groovy if you have some
background in java, but you can learn to use it as a scripting tool
anyway.

--
Les Mikesell
lesmi...@gmail.com

MauMau

unread,
Dec 27, 2014, 12:06:18 AM12/27/14
to jenkins...@googlegroups.com
From: <bms5...@gmail.com>
> I currently use Jenkins at my workplace for automated builds. My job title
> is Build Manager, so I do daily baselines/releases. I have just started
> using bash scripts for creating released files. I would like to learn it
> more in depth. Does anyone have any online tutorials or books that are
> helpful in bash scripting?

I recommend this as the best and most rich resource:

http://www.tldp.org/LDP/abs/html/index.html

Regards
MauMau

bl0ck3r

unread,
Dec 27, 2014, 8:26:23 PM12/27/14
to jenkins...@googlegroups.com
Scripts are great for writing process specific glue-programs and point tools.

I learned Bash from the internet, but after a while I bought the O'Reilly book "Learning the bash shell", it was worth very penny and this accelerated my learning: don't waste time, buy a book. I also often find answers I need in the Bash Guide on Greg's Wiki bit: http://mywiki.wooledge.org/BashGuide

I have found Groovy quite fun to learn, esp since it can access the java libraries (argparse4j being one of my favourites). The biggest advantage of Groovy over Python is that it runs on the JVM, so it was just two downloads to get everything. Groovy automatically downloads the additional libraries it needs via imports and Grape, not need to get IT involved, no root access required.

I still use Python 3 quite a bit, but only with the built-in libraries, since getting external libraries installed was hard for me on some legacy OSes. I still know enough Perl to fix old scripts, but I don't bother writing new scripts in it. Nowadays, for any problem that requires data structure manipulations (trees, lists), I start with Groovy (I have read part of the book "Programming Groovy 2" Venkat Subramaniam) . Last time I checked, Groovy performed really poorly with regular expressions, so when I have lots of them, I use Python instead (I have read O'Reilly Learning Python by Mark Lutz).
Reply all
Reply to author
Forward
0 new messages