SlideShare a Scribd company logo
1 of 13
Mastering the Jenkins Script Console
Sam Gleske – Integral Ad Science
About me
https://integralads.com/
GitHub user: @samrocketman
Jenkins community account: sag47
Twitter: @sag47
What to expect?
• Introduction to Jenkins Community Infrastructure
• What is the Script Console?
• Quick tips on Groovy
• DEMO: Security implications
• Operationalize Jenkins
• DEMO: The Script Console and Jenkins Configuration
• Links to help you grow
Keep in mind
Be curious and not shy away from source diving.
In the Script Console:
• List methods on a class instance.
– thing.metaClass.methods*.name.sort().unique()
• Determine a class from an instance.
– thing.class or thing.getClass()
Also keep in mind
• How do I configure reliably?
• How do I guarantee bootstrapping Jenkins works the
same way if done a year from now?
• How can I start effectively writing my own scripts?
Jenkins Community Infrastructure
• Artifactory Maven repo for WAR and plugins:
https://repo.jenkins-ci.org/
• Jenkins Update Center lists Maven GAV coordinates
http://updates.jenkins-ci.org/update-center.json
• Source on GitHub:
https://github.com/jenkinsci/jenkins - Jenkins core
https://github.com/jenkinsci/ - most plugins and infra configs
• Example bootstrap:
https://github.com/samrocketman/demo-jenkins-world-2017
https://github.com/jenkinsci/docker
What is the Script Console?
TL;DR Groovy… if you know Java
• Parenthesis on methods optional; Same goes for
semicolons at the end of lines.
• Setters and getters are automatically generated if
they don't already exist.
• Private methods are accessible. Private final
variables can be modified via reflection API.
• instance.getMyMethod() == instance.myMethod
• The last executed statement is the return value.
DEMO: Security Implications
Read passwd and credentials.
Operationalize Jenkins
• Enable CSRF protection.
• Use TLS and secure Jenkins with AuthN/AuthZ.
• Disable Jenkins CLI and any other services which are
not used.
• Do not allow anybody create job permissions.
• Bootstrap Jenkins by pinning the war and plugins to
specific versions. Refer to Jenkins Community
Infrastructure slide.
DEMO: The Script Console
and how it relates to Jenkins configuration.
Links to help you grow
• Learning Groovy - http://groovy-lang.org/learn.html
• Jenkins Community Scripts
https://github.com/jenkinsci/jenkins-scripts
• Script Console in Jenkins Wiki
https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console
• Examples in GitHub OAuth Plugin Wiki
https://wiki.jenkins.io/display/JENKINS/GitHub+OAuth+Plugin
• Configuration via Script Console is growing
https://issues.jenkins-ci.org/browse/JENKINS-31094
https://github.com/sandscape
https://github.com/samrocketman
Jenkins World 2017: Mastering the Jenkins Script Console

More Related Content

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn
 

Featured (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

Jenkins World 2017: Mastering the Jenkins Script Console

  • 1. Mastering the Jenkins Script Console Sam Gleske – Integral Ad Science
  • 2. About me https://integralads.com/ GitHub user: @samrocketman Jenkins community account: sag47 Twitter: @sag47
  • 3. What to expect? • Introduction to Jenkins Community Infrastructure • What is the Script Console? • Quick tips on Groovy • DEMO: Security implications • Operationalize Jenkins • DEMO: The Script Console and Jenkins Configuration • Links to help you grow
  • 4. Keep in mind Be curious and not shy away from source diving. In the Script Console: • List methods on a class instance. – thing.metaClass.methods*.name.sort().unique() • Determine a class from an instance. – thing.class or thing.getClass()
  • 5. Also keep in mind • How do I configure reliably? • How do I guarantee bootstrapping Jenkins works the same way if done a year from now? • How can I start effectively writing my own scripts?
  • 6. Jenkins Community Infrastructure • Artifactory Maven repo for WAR and plugins: https://repo.jenkins-ci.org/ • Jenkins Update Center lists Maven GAV coordinates http://updates.jenkins-ci.org/update-center.json • Source on GitHub: https://github.com/jenkinsci/jenkins - Jenkins core https://github.com/jenkinsci/ - most plugins and infra configs • Example bootstrap: https://github.com/samrocketman/demo-jenkins-world-2017 https://github.com/jenkinsci/docker
  • 7. What is the Script Console?
  • 8. TL;DR Groovy… if you know Java • Parenthesis on methods optional; Same goes for semicolons at the end of lines. • Setters and getters are automatically generated if they don't already exist. • Private methods are accessible. Private final variables can be modified via reflection API. • instance.getMyMethod() == instance.myMethod • The last executed statement is the return value.
  • 9. DEMO: Security Implications Read passwd and credentials.
  • 10. Operationalize Jenkins • Enable CSRF protection. • Use TLS and secure Jenkins with AuthN/AuthZ. • Disable Jenkins CLI and any other services which are not used. • Do not allow anybody create job permissions. • Bootstrap Jenkins by pinning the war and plugins to specific versions. Refer to Jenkins Community Infrastructure slide.
  • 11. DEMO: The Script Console and how it relates to Jenkins configuration.
  • 12. Links to help you grow • Learning Groovy - http://groovy-lang.org/learn.html • Jenkins Community Scripts https://github.com/jenkinsci/jenkins-scripts • Script Console in Jenkins Wiki https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console • Examples in GitHub OAuth Plugin Wiki https://wiki.jenkins.io/display/JENKINS/GitHub+OAuth+Plugin • Configuration via Script Console is growing https://issues.jenkins-ci.org/browse/JENKINS-31094 https://github.com/sandscape https://github.com/samrocketman