Top Banner

of 23

Jenkins Tips

Jun 01, 2018

Download

Documents

Acadeauadilie
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/9/2019 Jenkins Tips

    1/23

    DISCIPLINED INNOVATION

    JENKINS TIPSIdeas for making your life with Jenkins easier

  • 8/9/2019 Jenkins Tips

    2/23

    JENKINS TIPSNovember 2014

  • 8/9/2019 Jenkins Tips

    3/23

    When presented with a

    choice, pick a solution

    thats easy to confureand maintain! "

    #$e, %ust now&

  • 8/9/2019 Jenkins Tips

    4/23

    '()*+($-./his presentation is not meant to be

    rearded as scripture! (nstead, it

    captures the authors personalpreerences when dealin with

    enkins as a *ontinuous (nteration

    server!

  • 8/9/2019 Jenkins Tips

    5/23

    CONTENT TABLE

    1! enkins confuration

    2! enkins pro%ect confuration

    (nternal 3nly

    he presentation is divided into two bi chapters/

  • 8/9/2019 Jenkins Tips

    6/23

    1! enkins confuration

    (nternal 3nly

    1!a enkins installation1!b ost install confuration

  • 8/9/2019 Jenkins Tips

    7/23

    Standalone installationvs.

    Deploying to an application server

    1.a) Jenkins installation

    Standalone installation:- Native package available for Windows, MacOS and ost pop!lar

    "in!#$%SD distros- On Windows, Jenkins is installed as an independent service, and it is

    config!red to start a!toatically !pon syste boot

    Deploying to an application server potential advantages:- no e#tra port !sed &)- slig'tly lower (M !sage, in t'eory

  • 8/9/2019 Jenkins Tips

    8/23

    *diting Jenkins+ config!ration file

    1.b) ost install config!ration

    -'ejenkins.xmlfile is located in Jenkins installation folder /Windows 02

    bit defa!lt& 3&4rogra 5iles /#67)4Jenkins4).

    Recommended& c'ange Jenkins 8-- port fro its defa!lt val!e of

    6969 /to prevent c!rrent $ f!t!re -ocat conflicts)

    Optional& c'ange :ava version $ :ava arg!ents /i.e 2;;&2

  • 8/9/2019 Jenkins Tips

    9/23

    (!nning Jenkins as C"ocal Systevs.

  • 8/9/2019 Jenkins Tips

    10/23

  • 8/9/2019 Jenkins Tips

    11/23

    Jenkins =lobal Settings/'ttp&$$local'ost&F8--GportH$config!re)

    1.b) ost install config!ration

    -'e Global Settings screene#poses a liited set of basic configs,incl!ding&

    2 workspace $ b!ild root directories

    2 n!ber of e#ec!tors& n!ber of conc!rrent b!ild :obs

    2 JDI, N-, Maven installations

    -'is screen will also be !sed for config!ring additional pl!gins.

  • 8/9/2019 Jenkins Tips

    12/23

  • 8/9/2019 Jenkins Tips

    13/23

  • 8/9/2019 Jenkins Tips

    14/23

    nstalling additional pl!gins/'ttp&$$local'ost&F8--GportH$pl!ginManager$available )

    1.b) ost install config!ration

    Useful plugins:1)pre-scm-builstepL allows r!nning tasks before code c'ecko!t) !eploy to container pluginL deploy war to application server

    0) "mail-ext pluginL provides an !pgrade over t'e defa!lt eail

    pl!gin, being ore config!rable

    ) GitHub PluginL adds =it s!pport /Jenkins doesnt s!pport =it

    repositories o!t of t'e bo#)@) Grale PluginL adds =radle s!pport

    7) #ucumber $eports PluginL adds s!pport for creating ?pretty?

    3!c!ber reports

  • 8/9/2019 Jenkins Tips

    15/23

    3onfig!ring t'e email-extpl!gin for a gail acco!nt

    1.b) ost install config!ration

  • 8/9/2019 Jenkins Tips

    16/23

    2! ro%ect confuration

    (nternal 3nly

    2!a )tain" environment2!b $anain disk usae2!c 'ownstream pro%ects2!d 5sin scripts2!e 6uild triers2! -mail notifcations

  • 8/9/2019 Jenkins Tips

    17/23

    .a) CStaging environent

    -est pro:ect !pdates in a Cstaging environent

    before applying t'e to yo!r Cprod!ction Jenkins

    8owever, if t'e Cstaging environent is on a

    developent ac'ine, ake s!re yo! keep yo!r

    workspaces separatedE don+t c'eck Cdvanced

    ro:ect Options 2

  • 8/9/2019 Jenkins Tips

    18/23

    O!t of t'e bo#, Jenkins keeps everyt'ing forever

    .b) Managing disk !sage

    N.%& Depending on pro:ect specifics, additional clean !p ay be reP!ired /e.g. 3&4Windows4-ep)

    3'eck ?Days to keep artifacts? $ ?Ma# Q of b!ilds to keep wit' artifacts? /as appropriate)

    if yo! only want to delete artifacts /war,:ar,Aip) b!t keep logs$reports for pro:ect etrics

  • 8/9/2019 Jenkins Tips

    19/23

    .c) Downstrea pro:ects

    Define independent pro:ects for b!ild $ a!toated tests

  • 8/9/2019 Jenkins Tips

    20/23

    .d)

  • 8/9/2019 Jenkins Tips

    21/23

    .e) %!ild triggers

    %!ild triggering strategies&

  • 8/9/2019 Jenkins Tips

    22/23

    .f) *ail notifications

    Don+t spa Only send notifications for failed b!ilds /config!re trigger in t'e

    e#tended eail pl!gin+s Cdvanced Settings)

  • 8/9/2019 Jenkins Tips

    23/23

    Q & A