Getting Started with Jenkins: A VMWorld workshop

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

ADABAS to RDBMS UsingNatQuery. The following session will provide a high-level overview of NatQuerys ability to automatically extract ADABAS data from.
Jenkins User Conference San Francisco, Sept #jenkinsconf Business Process Model & Notation (BPMN) Workflows in Jenkins Max Spring Cisco
Introduction to Online Data Collection (OLDC) Community Based Abstinence Education September, 2009.
Jenkins User Conference Jenkins User Conference San Francisco, Sept #jenkinsconf Using Jenkins in the Enterprise and the Cloud Mark Prichard Kohsuke.
Windows Software Installation Tutorial GEFSOC Soil Carbon Modeling System Mark Easter, Kendrick Killian, Ting Feng, and Keith Paustian Natural Resource.
Terminal Server © N. Ganesan, Ph.D.. Reference Thin-Client Concept Thin-Client concept tutorial.
JOIN A COMMUNITY OF 80,000 E-COMMERCE SITES WORLDWIDE.
NetBeans IDE Downloading and Installation Guide. Downloading NetBeans IDE Installation Setup.
VMware vCenter Server Module 4.
Reproducible Environment for Scientific Applications (Lab session) Tak-Lon (Stephen) Wu.
Created By: Jeremy Callan Descore Inc ext. 5405
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Lawson System Foundation 9.0
Hosted Exchange The purpose of this Startup Guide is to familiarize you with ExchangeDefender's Exchange and SharePoint Hosting. ExchangeDefender.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. M I C R O S O F T ® Preparing for Electronic Distribution Lesson 14.
- California-based company specializing in online software training - Offers 999 video courses, with new courses added every week - Offers training in.
Eucalyptus Virtual Machines Running Maven, Tomcat, and Mysql.

Using the “Setup Assistant” to configure your new Mac Personalizing your new Mac.
Installing the SAFARIODBC.EXE For use with Excel May 3, 2002.
1 Guide to Novell NetWare 6.0 Network Administration Chapter 11.
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
Selenium Web Test Tool Training Using Ruby Language Discover the automating power of Selenium Kavin School Kavin School Presents: Presented by: Kangeyan.
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
VMware + Chef A VMworld Workshop.
How KeePass password safe can save you time and energy
Model a Container Runtime environment on Your Mac with VMware AppCatalyst VMworld Fabio Rapposelli
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
| nectar.org.au NECTAR TRAINING Module 10 Beyond the Dashboard.
MAE Continuous Integration Administration guide July 8th, 2013.
1 OPOL Training (OrderPro Online) Prepared by Christina Van Metre Independent Educational Consultant CTO, Business Development Team © Training Version.
Puppet with vSphere Workshop Install, configure and use Puppet on your laptop for vSphere DevOps Billy Lieberman August 1, 2015.
An Introduction to Progress Arcade ™ June 12, 2013 Rob Straight Senior Manager, OpenEdge Product Management.
Downloading and Installing Autodesk Revit 2016
Cisco Confidential © 2010 Cisco and/or its affiliates. All rights reserved. 1 MSE Virtual Appliance Presenter Name: Patrick Nicholson.
An Introduction to Designing and Executing Workflows with Taverna Aleksandra Pawlik materials by: Katy Wolstencroft University of Manchester.
Configuring Sourceforge’s CVS to work with Forte (3.0 or later) on WindowsNT and Windows 2000 Specific for MAExplorer.sourceforge.net Written by Eric Shen,
9/2/ CS171 -Math & Computer Science Department at Emory University.
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
SAFARI ODBC INSTALLATION Go to the TRECA home WEB page.
An Introduction to Designing, Executing and Sharing Workflows with Taverna Katy Wolstencroft myGrid University of Manchester IMPACT/Taverna Hackathon 2011.
Using LastPass. Great password management is impossible w/o a great tool Auto-fill (hands-free login) will save you approximately one hour per month You.
VDI-in-a-box TM 1 Kaviza Client End User Quick Start Manual.
Apache, MySQL and PHP Installation and Configuration Chapter 2 MySQL Installation and Configuration.
L.T.E :: Learning Through Experimenting Using google-svn for MtM Docs Development Denis Thibault Version 3.2 Mar 12 th, 2009.
| nectar.org.au NECTAR TRAINING Module 10 Beyond the Dashboard.
Folio3 IPhone Training Session 2 Testing App on device Presenter: Imam Raza.
SNG via Webinar. Where’s Webinar??  Double click Aflac 2000 folder  Highlight “SNGWebCommunicator”  Right Click and “Send To - Desktop”
Here are some things you can do while you wait 1.Open your omeka.net site in your browser (e.g. 2.Open.
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security.
Planning Server Deployments Chapter 1. Server Deployment When planning a server deployment for a large enterprise network, the operating system edition.
© 2013 IBM Corporation IBM UrbanCode Deploy v6.0 Support Enablement Training Jenkins plug-in 1 November 2013.
bitcurator-access-webtools Quick Start Guide
Welcome: Hands-On Lab Plug in to the network.
PTF for the PS Admin A PTF Overview for the PeopleSoft Administrator
Tivoli Storage Manager Product Family
Trends like agile development and continuous integration speak to the modern enterprise’s need to build software hyper-efficiently Jenkins:  a highly.
LMEvents SharePoint Portal How-to Guide
Lawson System Foundation 9.0
Software Testing With Testopia
Bomgar Remote support software
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
Cloud Connect Seamlessly
slides borrowed and adapted from Alex Mariakis and CSE 390a
Getting Started with Git and Bitbucket
Getting Started: Amazon AWS Account Creation
CGS 3175: Internet Applications Fall 2009
bitcurator-access-webtools Quick Start Guide
Carthage ios 8 onwards Dependency manager that streamlines the process of integrating the libraries into the project.
Presentation transcript:

Getting Started with Jenkins: A VMWorld workshop

Introductions Bob Webster Technical Marketing Manager VMware vCloud Air bwebster@vmware.com @rdpwebster Eric Smalling Consulting Architect DevOps by VMware Professional Services esmalling@vmware.com @ericsmalling

About Us: VMware DevOps Consulting Services Developer friendly. Enterprise ready. Assessment Strategy development People, process & technology transformation for Continuous delivery Configuration management Cloud operations Security & resilience optimization Our team of dedicated DevOps experts provide: Build and deliver applications sooner Fuel innovation and accelerate time to market Transform your enterprise to support high velocity, modern application development Deploy an agile future-ready datacenter where any app can thrive

Agenda What is Jenkins? Installing Jenkins Lab1: A Quick Tour of Jenkins Configuring Jenkins & Plugins Lab2: CI with Jenkins Demo: vSphere Integration

What is Jenkins?

Jenkins Jenkins is a free / Open Source application that monitors the executions of repeated jobs It’s primarily used as a Continuous Integration Tool for building software. Jenkins Home Page http://jenkins-ci.org/

Jenkins and Hudson Too many butlers? Before Jenkins, there was Hudson. Hudson was written by Kohsuke Kawaguchi at Sun Microsystems When Oracle bought Sun and planned for a Commercial version of Hudson, the open source community including Kohsuke Kawaguchi created Jenkins. Interest in Hudson declined dramatically and Oracle donated the source to the Eclipse Foundation in 2012 Today, Jenkins is a much more active project.

Installing Jenkins

Installing Jenkins The Jenkins Home Page http://jenkins-ci.org provides native package installers for many platforms. In this workshop we will cover installation for Windows and OSX. Long Term Stable (LTS) version is usually the best for most uses.

Windows Install as a windows service Mac OSX Install Ensure Java is installed (run “java” at Terminal and follow prompts if it’s not installed yet) Visit the Jenkins home page http://jenkins-ci.org Click on the Mac OSX native package installer link and download the package Double click the .pkg in the downloads folder on your Mac. Enter your admin password to permit the install. When the installer loads, accept the license and accept all defaults. When complete, access the Jenkins home page on your laptop at http://localhost:8080/ Visit the Jenkins home page http://jenkins- ci.org Click on the Windows native package installer link and download the package Unzip the package Run the installer When complete, access the Jenkins home page on your laptop at http://localhost:8080/ http://jenkins-ci.org/content/thank-you-downloading-windows-installer https://wiki.jenkins-ci.org/display/JENKINS/Thanks+for+using+OSX+Installer Java and OS X 10.9 Mavericks or 10.10 Yosemite Oracle Java 8 on Mavericks or Yosemite needs Apple's Java 1.6 to function. However, all of the symlinks in /usr/bin point to Java 1.6, so when a Jenkins tries to run via /Library/Application Support/Jenkins/jenkins-runner.sh, it launches using Java 1.6. To run under Java 8, you need to do the following:  Install Apple's Java from http://support.apple.com/kb/DL1572 Install Oracle Java 8 Edit jenkins-runner.sh:  Add the line:  export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home" Change the last two lines to read:  echo "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" $javaArgs -jar "$war" $args exec "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" $javaArgs -jar "$war" $args Jenkins will now run using Java 8.  Start / Stop Service: To start/stop them manually, use the service manager from the control panel Start / Stop Daemon: sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist

Run via Java Command Line Run in Docker container Visit the Jenkins home page http://jenkins- ci.org Click on the link under “Java Web Archive (.war) Open a shell and cd to the download directory Run this command: “java –jar jenkins.war” Access the Jenkins home page on your laptop at http://localhost:8080/ CTRL-C will kill the process docker pull jenkins docker run jenkins_home (You’ll probably want to attach a volume for Jenkins to store its data) Mention these but not for students to do now (unless they want to) If Eric’s laptop is being used, Jenkins will be running via command line as shown here

Install Git Windows Visit the link http://git-scm.com/downloads Click on the Windows download icon Click on the downloaded .exe file to run the installer. Select ‘Use Git from the Windows Command Prompt’ Accept all other defaults Mac OSX Open Terminal, type “git”. If not installed a window should prompt you to install the XCode command line tools. Click “Install”. Other options: http://git-scm.com/downloads Homebrew users: brew install git

Lab 1: A Quick Tour of Jenkins Create a simple job View execution results Show how errors are reported

Lab 1: Quick Tour of Jenkins Step 1: Click “create new jobs” or “New Item” Step 2: Give your job a name Select “Freestyle Project” Click “OK” Step 3: Scroll down to the “Build” section Click “Add build step” and select either “Execute shell” (Mac) or “Execute batch command” (Windows) from the drop down menu.

Lab 1: Quick Tour of Jenkins Step 4: Add a script that logs lines over several seconds Click “Save” Step 5: You are presented with the project status page Click “Build Now” to run your project Note the build history will change

Lab 1: Quick Tour of Jenkins Step 6: Click the “1” link to open that run’s status page This job is very basic so not much info is presented; a lot more data can be shown on this page (more on that later). Note the “Sunny” icon in the Build History panel. This indicates relative build status over the last several builds. Sunny = all passing Step 7: Click “Console Output” on the left side of the page The console output of the running job is listed NOTE: If you open this page while the job is still running, the log will be live, scrolling as more data comes in. (similar to “tail –f”) Tip: Clicking the ball or progress bar in the “Build History” panel will take you straight to the that run’s console output.

Lab 1: Quick Tour of Jenkins Step 8: Navigate back to your project status page by clicking on the “Status” link Click on the “Configure” link to re-open the project’s configuration form Step 9: Scroll down to the Build -> Execute Shell (or batch command) section and add “exit 1” to the bottom of the script (same for Windows or Mac) Click Save Click Build Now

Lab 1: Quick Tour of Jenkins Step 10: Notice the red icon next to the 2nd run in build history (when it completes the run) which indicates failure. Also note the “weather” icon has changed to “cloudy” because we have 50% failure rate. Step 11: Go back into the configuration page (click “Configure”) Remove the “exit 1” line you added earlier Click Save Click Build Now The 3rd run should go back to Blue/Pass state Weather is now “partly sunny” as the builds are now 66% passing.

Configuring Jenkins & Plugins

Configuring Jenkins Configure System Configure Global Security Central place for global configuration settings Plugins can add sections if needed Allows system-wide governance of the build tools used JDK versions Ruby versions Configure Global Security Several authentication options Provides various levels of authorization granularity Extensible by plugins Secure credential store Manages credentials for external systems so that projects don’t have to invent their own schemes.

Jenkins Plugins Jenkins has over a thousand plugins that extend its functionality. Extensibility points within Jenkins enable anyone to create a plugin. A list of all available plugins is available on the Jenkins Plugin Page https://wiki.jenkins-ci.org/display/JENKINS/Plugins In this tutorial we will be using these plugins GitHub plugin

Lab 2: CI with Jenkins Setup a continuous integration project Automatic builds and deploys to vCloud Air

Lab 2: Continuous Integration In this lab you will setup a continuous integration project. Your project will automatically build and deploys an application to vCloud Air when source changes are made. Step 1: Clone (create) a local source code repository on your laptop Step 2: Setup a post-commit hook so Git will call Jenkins when code changes are made. Step 3: Create a new Jenkins Project that will build the source code Step 4: Modify the code and commit the change Step 5: Watch Jenkins checkout and deploy the new code Step 6: Test the change with a browser http://andrew-hoyer.com/experiments/cloth/ https://github.com/Dissimulate/Tearable-Cloth Lab Instructions http://devops.vcair.us/labs/jenkins.html

Jenkins Masters and Slaves A normal Jenkins install acts as a master and uses its resources to run all jobs. An executor is the component the does the work. To perform a lot of parallel builds, slaves can be configured to perform work. A slave is a computer that is set up to offload build projects from the master and once setup this distribution of tasks is fairly automatic. The slave runs a slave agent, a full Jenkins install is not required. Jobs can be set to stick to a specific slave for a build or roam across slaves

Jenkins + vSphere Integration

vSphere Integration The vSphere Plugin offers two modes of integration In-project build step level Perform vSphere operations inline with your job steps Ensure VM is running before build or test Shut down VM upon completion Reset target VMs to known good state before / after job run etc Automated slave provisioning / de-provisoning Starts VMs to act as slave instances as load requires them Shuts VMs down when no longer needed Useful for build / test spikes Specialized build platforms/OS’s/tools Resetting a slave to known good state

vSphere Deployment Demo Demo prerequisites: vSphere ESXI is available and accessible by Jenkins A VM is available with Ubuntu 14.04 Server and the following installed: open-vmtools Nginx /usr/share/nginx/html writable by the user Jenkins will be using. A snapshot taking in vSphere of this state

vSphere Deployment Demo System configuration Install the “vSphere Plugin” and “SSH plugin” On Jenkins Configure System page, go to “Cloud” and select “vSphere Cloud” from the “Add a new cloud” dropdown menu. Enter your vSphere host, credentials and a name for this vSphere Cloud. Click “Test Connection” button to validate connectivity. Scroll up to the “SSH remote hosts” section and click the “Add” button. In the “hostname” field enter “$VSPHERE_IP”.

vSphere Deployment Demo System configuration (cont.) Fill out the rest of the fields with the credentials for your VM user (ignore server connection form error) Click “Save” at bottom of page. Create a test job: Create a new “FreeStyle” job. Enable “This build is parameterized” and add a “String Parameter”. Name: TEST_STRING (put anything you want in the “Default Value”

vSphere Deployment Demo Create a test job (cont.): In the “Build” section add two “vSphere Build Step”s In the first one, choose your vSphere server (using the cloud name you entered in the system configuration) and choose the “Revert to Snapshot” action. Fill out you VM name (from vSphere) and snapshot for the basic nginx install. In the second one, choos your vSphere server again and choose “Power-On/Resume VM” or it’s action. Fill out the VM name again here Add a “Execute shell on remote host using ssh” build step. Choose the SSH site you entered in the system configutation In the Command field enter: echo "$TEST_STRING" > /usr/share/nginx/html/index.html

vSphere Deployment Demo Create a test job (cont.): Add a “Execute shell” build step and enter the following in it’s Command field: curl -s http://$VSPHERE_IP | grep "$TEST_STRING” Click “Save”, and the “Build with Parameters” A parameter form will appear – enter some text in it (or leave the default if you wish) and click “Build” While the build is running, open the console output and note that the vSphere log entries. Also, if your vSphere client console is available, note the “Recent Tasks” entries that coincide.

vSphere Deployment Demo Create a test job (cont.): When complete, the log should show the text entered in the build parameter as being returned by the web server via the “curl” command. Additionally you could open a browser to the VM and see the same text.

Hints, Tips, Q&A

More Information Jenkins Home: http://jenkins-ci.org Jenkins Documentation Wiki Mailing Lists IRC Bug Tracker Latest Jenkins CI builds and results (yes, Jenkins builds Jenkins) Jenkins User Conference: https://www.cloudbees.com/company/events/juc News about upcoming conferences Video and slides for past conferences Highly recommend session from 2014 SFO conference: Seven Habits of Highly Effective Jenkins Users by Andrew Bayer https://www.cloudbees.com/event/topic/seven-habits-highly-effective-jenkins-users-0

More Information Jenkins related Twitter feeds Our Twitter feeds @jenkinsci @jenkinsconf @jenkins_release @CloudBees @kohsukekawa Our Twitter feeds Bob Webster: @rdpwebster Eric Smalling: @ericsmalling

Q & A