Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using Jenkins as Native Packages Factory

Using Jenkins as Native Packages Factory

Describe how to use Jenkins to setup a Native Packages Factory.

Avatar for Henri Gomez

Henri Gomez

April 17, 2012
Tweet

More Decks by Henri Gomez

Other Decks in Technology

Transcript

  1. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Using Jenkins

    as Native Packages Factory Henri Gomez Axway http://www.axway.com
  2. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf About me

    !   CI Architect @ Axway ! Was Senior Ops Director ! Was Developer, TL and Architect ! JPackage Project Founder ! OpenJDK 7 & 8 packages for OSX !   ASF Member (Tomcat & XMLRPC)
  3. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Native Packages

    !   Heart of OS applications stack !   Dependency handling !   Automatic or selective updates !   Widely used by Ops !   Well suited for Cloud based Operations
  4. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Linux Packaging

    !   RPM (Redhat Package Manager) –  RHEL/CentOS/ Fedora –  SLES/OpenSuse –  Mandriva !   DEB –  Debian –  Ubuntu
  5. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Package Definition

    !   A file(.rpm, .deb) !   An archive (Datas & Programs) !   Executed code at install, update or remove time. !   Architecture related. –  Intel, ARM, PowerPC –  32 or 64bits !   Or architecture neutral –  Java application –  Ruby library
  6. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Package Benefits

    ! Describing requirement ! Provide programs, datas and settings ! Registering in system service(ie: logrotate) ! Enforcing dedicated run account !   Total control over runtime cycle-life –  Installation –  Update –  Uninstallation A package is much more than an archive
  7. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Maven common

    facts !   DSL build based !   Dependency Management –  At build time –  At deploy time !   Packages repositories –  In local mode –  Remotely via HTTP !   Nexus and Artifactory could act as RPM repositories
  8. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf From application

    to RPM !   2 approachs –  OS Vendor way: •  Rebuilt from sources tarballs •  Require tarballs in build path –  Enterprise way: •  Rebuilt from Binaries (stored in Artifacts Repository) •  Avoid duplicate processing •  Trusting your delivery process
  9. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf RPM building

    – SPEC FILE !   Sources !   Architecture ! Build Requirements ! Deploy Requirements ! Build ! Assembly !   Contents locations and rights
  10. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Jenkins as

    a Packages Factory !   Jenkins Master –  Get contents from SCM (Subversion, Git) –  Prepare build environment –  Trigger build on slaves !   Jenkins Slaves –  One slave by target (OS/Arch) platform –  Confident in OS compatibility –  Deployment on RPM repositories
  11. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Axway Packages

    Factory !   Builder –  5 target OS •  CentOS 5 / 6 in 32 and 64 bits •  OpenSuse 12.1 in 32 and 64 bits •  Suse SLES 11 in 64 bits !   Distributor –  Apache HTTPd server –  Packages Repositories hosting and servicing •  4 repos for CentOS 5/6 in 32/64 bits •  1 repo for OpenSuse 12.1 32/64 and SLES 11.
  12. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Axway Packages

    Factory Builder i5 3.0Ghz, 16GB RAM, 500Gb HD Host OS OpenSuse 12.1 VirtualHost 4.1.8 7 Hosted VMs CentOS 5 32 bits CentOS 5 64 bits CentOS 6 32 bits CentOS 6 64 bits OpenSuse 12.1 32 bits OpenSuse 12.1 64 bits Suse SLES 11 64 bits
  13. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Jenkins Factory

    in-depth !   Builder –  take control on slaves via SSH –  Trigger build jobs after SCM change –  Trigger jobs on 5/6 VMs via Matrix Plugin !   Slaves –  Build package on OS / Arch –  Send build packages to distributor via SCP !   Distributor –  Reindex repositories via cron if something change
  14. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Jenkins Factory

    in-depth Parallel build on slaves (Matrix) Build binaries uploaded via SCP Repositories reindexed by cron if update detected New packages immediatly available remotely via HTTP
  15. Jenkins User Conference Paris, 17 April 2012 #jenkinsconf Packages Tricks

    ! CentOS/RHEL use one repo by arch –  One repository for x86 32bits with native/noarch –  One repository for x86 64bits with native/noarch è One slave by architecture for native è Use one slave builder by arch even for noarch packages ! OpenSuse/SLES use a common repository –  One dir for x86 32bits –  One dir for x86 64bits –  One dir for noarch è One slave by architecture for native è You could use 32 or 64 bits builder for noarch packages