Slide 1

Slide 1 text

Jeanne Boyarsky & Scott Selikoff Tuesday Oct 23, 2018 Oracle Code One – HOL4957 Automating your CI/CD Stack with Java and Groovy Please begin installing Docker/Jenkins/Nexus NOW! https://goo.gl/XesKPB

Slide 2

Slide 2 text

@jeanneboyarsky @scottselikoff About Us Combined •  30+ years Java •  15+ years tooling •  10+ years Groovy

Slide 3

Slide 3 text

Tuesday More from Jeanne Time Title Comments Speaker 4:00-4:45 DevSecOps: Java Developer’s Guide to Automating with Groovy Companion talk; can use to reinforce lab Jeanne Boyarsky 7:30-9:15 Ignite talks! Jeanne has 5 minute talk on her robotics team Various

Slide 4

Slide 4 text

Wednesday Recommendations Time Title Speaker 1:30-2:15 Functional Programming in Java, Groovy & Kotlin Ken Kousen 2:30-3:15 JVM Languages: Compare (Java, Kotlin, Groovy, Scala) Leonardo Lima, Nikhil Nanivadekar & Donald Raab 2:30-3:15 Which Java Version from Which Java Vendor with What Support Jeanne Boyarsky

Slide 5

Slide 5 text

What you’ll learn in the lab •  Ways you can run Groovy in Nexus/Jenkins •  Using object model APIs from Groovy •  Configuring a custom Java Sonar rule •  The initial steps in securing a system

Slide 6

Slide 6 text

Technologies used in this Lab •  Docker •  Jenkins •  Nexus Repository Manager •  SonarQube

Slide 7

Slide 7 text

Docker •  Container-based Platform •  Virtualized environment •  Mini “slice” of a virtual machine •  Stored as images, run as containers •  All tools for this lab run will run from Docker

Slide 8

Slide 8 text

Overview HOL Network Docker container Nexus Docker container Docker container Jenkins Sonar Binary repository CI Engine Static analysis

Slide 9

Slide 9 text

Docker Run Stop Start Remove

Slide 10

Slide 10 text

Jenkins •  Management tool for continuous integration and continuous delivery •  CI: Checking in code triggers builds •  CD: Builds are sent to various environments •  Highly customizable with numerous scripting and automation options •  Run as projects steps/pipelines

Slide 11

Slide 11 text

Nexus Repository Manager •  Serves dependencies to Maven/Gradle •  Store snapshot and release artifacts (builds) •  Similar to Artifactory

Slide 12

Slide 12 text

SonarQube •  Continuous Inspection of code quality •  Exposes bugs and potential vulnerabilities using static code analysis •  Focuses on the structure of code and enforcing rules across a project

Slide 13

Slide 13 text

Other tools/languages •  Groovy – JVM programming language •  curl – command line (we use to test network connectivity)

Slide 14

Slide 14 text

One minute intro to Groovy Groovy Java For this lab •  Use Java if you don’t know Groovy •  All Groovy code in solution guide for reference (or copy/paste) •  Don’t waste time on Groovy syntax if don’t already know Groovy. •  More on Groovy syntax at 4pm

Slide 15

Slide 15 text

log.info'Hello Oracle Code One! ’ log.info GroovySystem.version

Slide 16

Slide 16 text

println 'Hello Oracle Code One! ' println GroovySystem.version Hello Oracle Code One! 2.4.11

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

System scripts can access object model Can’t choose Groovy version

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Script Security Plugin ERROR: Build step failed with exception org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessExce ption: Scripts not permitted to use staticMethod jenkins.model.Jenkins getInstance Options: •  Approve each script manually •  Sandbox - whitelist APIs •  Authorized Build plugin to run as admin •  Copy/paste Groovy code (we do this in the lab)

Slide 21

Slide 21 text

Flow •  The lab is self paced •  Raise your hand if you get stuck or have a question. •  If there is a FAQ, we will demo it on the screen.

Slide 22

Slide 22 text

Let’s start! On to the lab! In a browser go to https://goo.gl/Gc3uyy Start with the Lab Instructions: Automating Stack HOL Instructions.docx