SlideShare a Scribd company logo
From Zero to CI/CD
Building your first CI Process
Nir Koren
DevOps CI/CD Team Leader, LivePerson Israel
My challenge / goals today
Each one of you will understand:
What is CI / CD
What is Git / GitHub and why most of the industry use it.
Same goes to Apache Maven
Same goes to Jenkins CI
Each one of you will have:
“hello-world” CI process on his/ her Laptop.
What will we cover today?
• Introduction
• Introduction to CI/CD
• Introduction & hands-on to Git and GitHub Basics
• Introduction & hands-on to Maven Basics
• Introduction & hands-on to Jenkins Basics
• Connect all together
What will we NOT cover today?
We are not going to develop anything today.
Not all of us comes from the same background and this not in the Workshop agenda.
Containerized applications: Docker / Kubernetes
Not enough time BUT it goes the same for those technologies as well.
Jenkins Pipelines and Shared libs
Not enough time but we will play with the pipeline in a nutshell.
Agenda
09:00 – 10:30: Introduction to CI / CD
10:30 – 11:00: Coffee Break
11:00 – 12:30: Introduction to Git / GitHub
12:30 – 13:30: Lunch
13:30 – 15:00: Introduction to Maven
15:00 – 15:30: Coffee Break
15:30 – 17:00: Introduction to Jenkins & connect all
WE WILL HAVE TO BE FLEXIBLE
$ whoami
Nir Koren, DevOps CI/CD Team Leader, LivePerson Israel
Doing and implementing DevOps and CI / CD for 10+ years
https://il.linkedin.com/in/nirkoren
https://www.facebook.com/koren.nir
@KorenNir
@nir_koren
I work for LivePerson
100% Cloud SaaS company
Founded in 1995, Headquartered in NYC
Public since 2000 (NASDAQ: LPSN)
1000 Employees over 14 offices
19,000 customers, 27M interactions / Month
CICD_1670665418.pdf
CICD_1670665418.pdf
Introduction to
CONTINUOUS INTEGRATION / DELIVERY
What is Continuous Integration?
“A key software development practice
where members of a team integrate
their work frequently.”
Martin Fowler, Continuous Integration:
http://martinfowler.com/articles/continuousIntegration.html
What is Continuous Integration?
Continuous integration involves integrating early and often,
in order to avoid "integration hell“
CI / CD Main Goal
Provides a rapid feedback.
If a defect is introduced into the code base, it can be
identified and corrected ASAP.
Why CI/CD?
• Frequent changes  Less integration problems.
• Bugs are detected earlier  Saves money.
• Avoid last minute chaos.
• Transparency to all.
• Testing on Production-Like env.
• Easy to rollback in case of any issue.
• Enforce of automation culture.
• Enforce DevOps culture.
• Make the developers accountable and take ownership.
CI Principles
• Automate the build (single command), Automate all.
• Build is self testable.
• Baseline branch is open consistently.
• Every commit should be built.
• Build should be fast.
• Test Env is clone of Production (as much as we can).
• Everyone can see the status – Transparency.
What is
CONTINUOUS DELIVERY / DEPLOYMENT
Code
Test
Deploy
Build
Continuous Delivery (CD) is a software development discipline where you build
software in such a way that the software can be released to production at any
time.
Continuous Deployment means that every change goes through the pipeline and
automatically gets put into production, resulting in many production deployments
every day.
Continuous Delivery & Deployment
Continuous Deployment
Continuous Delivery
Auto Auto Manual
Build Deployment Tests Production
Auto Auto Auto
Build Deployment Tests Production
CD Principles
• The Software is always deployable through it’s lifecycle.
• Anybody can get fast and automated state of
Production.
• You can perform push-button deployments any time
CD Common structure
Code
Test
Deploy
Build
CD is not only in Computer Software
Tesla Model S gets firmware updates on regular basis for both UI and
major elements (suspension, acceleration and more)
Introduction to
Git & GitHub
CICD_1670665418.pdf
Lets install git & create GitHub account
Linux based: $ sudo apt-get install git
Windows: Download from https://git-scm.com/
Mac: $ brew install git Or download from https://git-scm.com/
Initial configurations:
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
Check your configurations:
$ git config -l
https://github.com/
Sign Up
Git installation / configuration files.
/usr/local/bin
INSTALLATION DIRECTORY
C:Program FilesGit
~/.gitconfig
CONFIGURATION DIRECTORY
CODE REPOSITORY
[user]
name = Nir Koren
email = nirk@liveperson.com
[merge]
tool = p4merge
…
.git
Git is an Open Source, Distributed and
popular version control system.
Designed for Speed and Efficiency
What is Git?
Open Source
• Free
• Popular
• Highly contributed by the community and GitHub
Popular
• Multi-platform support
• Multiple GIU’s
• Fully command lined – great for CI / Automation
• Contains any IDE / Integrated plugins
Fast
• Performing a diff
• Viewing file history
• Committing changes
• Merging branches
• Obtaining any other revision of a file
• Switching branches
• No Network needed.
First release @ 2005 for Linux Kernel source code.
New free alternative for BitKeeper.
History & Founder
I'm an egotistical bastard, and I
name all my projects after myself.
First “Linux” and now “git”.
Linus Torvalds
Git: Under the hood
Key Concepts
COMMIT
A Snapshot in the repository
State of the project in a certain time. Point of a tree
BRANCH
A label with user-friendly name. Point to a commit.
TAG
A descriptive name to a list of commits.
Technically – it’s all the same
Key Concepts
REMOTE
Can be origin (where it cloned from) or upstream (custom)
The version that hosted in the server. Can be remote host or local clone.
CLONE
Copy of a repository locally on your laptop. Comes with metadata relationship to the remote
repo
FORK
A personal copy of a repository that lives remotely on a user account and holds relationship
with the original repo..
Git: Areas
Workspace Staging Repository Remote
git add git commit git push
git checkout
Git reset
<file>
Git reset –hard (will do all files)
git revert (will keep history) or git reflog / reset HEAD^ or reset –hard origin/master
CICD_1670665418.pdf
Perforce new products
contains integration to
Git
FORGET Perforce
FORGET ClearCase
FORGET SVN
FORGET Any VCS you know
It’s much easier to teach a person who doesn’t know any
VCS
The best way to learn Git
Philosophy
• While SVN trunk is development, GIT Master is Release.
• Anything in origin master is deployable.
• Create a descriptively named branch for new feature development
• Commit early and often to new branch locally
• Ensure that each commit represents one idea or complete change.
• Push your new branch work to the same named branch on origin
Introduction to
What is GitHub?
Web-based hosting service for version control using Git.
The largest source code in the world
GitHub Company
• Founded in 2007.
• Headquartered in San Francisco, 800+ employees
• GitHub.com > 35M users, 100M Repositories
• Core GitHub developers are core Git OS contributors
• Cool brand (shop, merchandizing, crazy company)
Pricing models
• Free: your code is open and visible to all
• Personal: your code is private and you can share.
• Business (hosted): private in the cloud Github.com
• Business (Enterprise): On-premise. Install and
maintain on your own.
Partial features list of
WHY GITHUB?
In-place editing using Ace Editor
Both Machine and Human Code Review
Code Search engine
Rich documentation and API
GitHub Pages
GitHub WIKI
GitHub Issues
Forks model – Open Source work model
Pull Request
Tell others about your change, Let human / machine to review your code.
Communicate with Emojis
Manage your tasks in Board
Key Concepts
ORGANIZATION
Group of 2 or more users that typically acts like a real org / company. It administrated and contains
teams, users and repos.
REPOSITORY
Collection of files with metadata (.git folder) that contains history, revisions etc’
COLLABORATOR
A person who had read / write permissions to a repository.
CONTRIBUTOR
A person who contributes to a repository but has no collaborator access. Only PULL requests.
Practice
Introduction to
Apache Maven
CICD_1670665418.pdf
• Make sure you have JDK8
• Ensure JAVA_HOME env var is pointed to the JDK8
• Download Maven https://maven.apache.org/download.cgi
• Place (unzip / extract) the Maven somewhere and add the <MAVEN>/bin
to your env var PATH
• Run “mvn -v” to verify the installation
Let’s install Maven first
• In Yiddish: accumulator of knowledge
• Releases 1.x: 2002, 2.x: 2005, 3.x (Current): 2009
• Successor of Apache ANT (*)
• A standard way to build projects (Java mainly).
• A Framework (open & extendable)
What is Apache Maven?
What is “Build”?
History of build tools
Maven directories structure
src/main/java Application sources
src/main/resources Application resources
src/main/webapp Web application sources
src/test/java Test sources
src/test/resources Test resources
Maven Architecture
Project: src/main/java…
Local Repository
(~/.m2/repository)
Proxy
Install
Deploy
Maven Configuration
General Configuration: ${maven.home}/conf/settings.xml
User Configuration: ${user.home}/.m2/settings.xml
<settings>
<localRepository/>
<interactiveMode/>
<offline/>
<pluginGroups/>
<servers/>
<mirrors/>
<proxies/>
<profiles/>
<activeProfiles/>
</settings>
Maven it’s just a
core framework
for Maven Plugins
$ mvn com.someorg.somegroup:some-name:1.0.0.0:any_goal –Dsomeproperty=xxx
Maven Plugins
Maven Built-in Plugins (partial List)
clean
Clean up after the build.
compiler
Compiles Java sources.
deploy
Deploy the built artifact to the remote repository.
install
Install the built artifact into the local repository.
resources
Copy the resources to the output directory for including in the JAR.
surefire
Run the JUnit unit tests in an isolated classloader.
Maven Lifecycle (partial list)
validate validate the project is correct and all necessary information is available.
compile validate the project is correct and all necessary information is available.
process-resources copy and process the resources before build
test run tests using a suitable unit testing framework
package Take the compiled code and package it in its distributable format
install Package + put it in the local repo
deploy Install + upload to the artifact repository
Maven Versions
General Structure (In LP we use 4 digits):
1.0.0.0-SNAPSHOT
Major Version – Main content of a release
Minor Version – Enhancements (Service Packs)
Micro version – Bug fixes
HotFix version – Emergency fixes
Latest version – Latest version we have
Maven SNAPSHOT Update Policy
How often should we check for SNAPSHOT update?
Can be configured in the settings.xml By default is “daily”.
• “always”
• “daily”
• “interval:XXX” (in minutes)
• “never”
• Can be done always also via CMD with –U flag
POM
Parent Reactor Module
Maven POM Structure
<project>
<modelVersion>4.0.0</modelVersion>
<!-- The Basics -->
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<packaging>...</packaging>
<dependencies>...</dependencies>
<parent>...</parent>
<dependencyManagement>...</dependencyManagement>
<modules>...</modules>
<properties>...</properties>
<!-- Build Settings -->
<build>...</build>
<profiles>...</profiles>
</project>
Maven POM structure
General artifact information
<groupId>com.company.something</groupId>
<artifactId>name-of-artifact</artifactId>
<version>xxx-SNAPSHOT</version>
<packaging>jar</packaging>
Maven POM structure
Dependencies
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-api</artifactId>
<version>xxx</version>
<scope>${scope}</scope>
</dependency>
Scopes: compile (default), provided, runtime, test (partial list)
Maven POM structure
Parent
<parent>
<groupId>com.mycompany.xxx</groupId>
<artifactId>my-parent</artifactId>
<version>123</version>
</parent>
Get main definitions to all child projects.
Parent
PARENT POM
SERVICE #1
POM
SERVICE #2
POM
SERVICE #3
POM
SERVICE #4
POM
Multi module project
• Collects all the available modules to build
• Sorts the projects into the correct build order
• Builds the selected projects in order
<modules>
<module>module1</module>
<module>module2</module>
<module>module3</module>
</modules>
Module1
Module2
Module3
Reactor (parent)
Reactor POM
pom.xml
Dependency / plugin management
<plugin>
<groupId>com.myorg</groupId>
<artifactId>myplugin</artifactId>.
</plugin>
Allows project authors to directly specify the versions or configuration
of artifacts or plugins where there is no version / configuration. Can be
overwritten in the plugin itself.
<pluginManagement>
<plugin>
<groupId>com.myorg</groupId>
<artifactId>myplugin</artifactId>.
<version>1.1.1.1</version>
</plugin>
</pluginManagement>
Maven Profiles
Subset of elements in the POM that can be triggered in many ways.
Can be defined both in the pom.xml or in the settings.xml
<profiles>
<profile>
<id>my_profile_id</id>
…
</profile>
</profiles>
$ mvn clean install –Pmy_profile_id
Maven Profiles Activation
<profiles>
<profile>
<id>my_profile_id</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
Maven Profiles Activation
<profiles>
<profile>
<id>my_profile_id</id>
<activation>
<jdk>1.8</jdk>
</activation>
</profile>
</profiles>
Practice
Introduction to
Jenkins CI Server
CICD_1670665418.pdf
• Download Jenkins (Preferred LTS) https://jenkins.io/
• Open up a terminal in the download directory.
• Run java -jar jenkins.war --httpPort=9090.
• Browse to http://localhost:9090.
• Follow the instructions to complete the installation.
Docker?
$ docker run -d -p 9090:8080 -u root -v
/Users/nirk/jenkins_home:/var/jenkins_home jenkins/jenkins:lts
Let’s install Jenkins first
Jenkins is open source automation server which can be used to
automate all sorts of tasks related to building, testing, and delivering or
deploying software.
Jenkins can be installed through native system packages, Docker, or even
run standalone by any machine with a Java Runtime Environment (JRE)
installed.
What is Jenkins?
• Funded by Kohsuke Kawaguchi as Hudson CI (in that time he was a
developer in Sun Microsystems).
• First Hudson release was in 2004.
• Oracle acquired Sun in 2010 and claimed the right to the ”Hudson”
name and applied for a trademark in December 2010.
• Kohsuke forked Hudson open source and created the name “Jenkins” –
the rest is history.
History of Jenkins
Why Jenkins?
A platform, Free, Open source. Easy to install
and easy to use
Provides built-in Authentication & Authorization
Login Jenkins Server LDAP
GITHUB User base
SAML IDP
Local User base
Authorization Rules
Open platform
JSON API
XML API
1000+ plugins
Extendable
Write your own plugin Support Groovy DSL Groovy declarative pipelines
Popular by the community
Short-time (rapid) Development
Practice

More Related Content

PPTX
Introduction to git hub
PDF
Git SVN Migrate Reasons
PDF
Git Mastery
PDF
Intro to DevOps 4 undergraduates
PPTX
Que nos espera a los ALM Dudes para el 2013?
PDF
Version Control With Git Powerful Tools And Techniques For Collaborative Soft...
PDF
Rc094 010d-git 2 - desconocido
PDF
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Introduction to git hub
Git SVN Migrate Reasons
Git Mastery
Intro to DevOps 4 undergraduates
Que nos espera a los ALM Dudes para el 2013?
Version Control With Git Powerful Tools And Techniques For Collaborative Soft...
Rc094 010d-git 2 - desconocido
Portable CI wGitLab and Github led by Gavin Pickin.pdf

Similar to CICD_1670665418.pdf (20)

PPTX
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
PPTX
Git & GitLab
PDF
Enterprise git
PDF
Git introduction for Beginners
PDF
Starting with Git & GitHub
PPTX
Git session 1
PDF
TMF2014 CI-CD Workshop Michael Palotas
 
PPTX
Introduction to git and Github
PPTX
Git hub_pptx
ODP
Introduction to Git
PDF
Promise of DevOps
PPT
Introduction to Git
PPTX
EdTechJoker Spring 2020 - Lecture 2 - Git
PPTX
Git and GitHub (1).pptx
PDF
True Git
PPTX
Git And Git Hub.pptx
PPTX
Interview preparation devops
PPTX
Devops
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
Git & GitLab
Enterprise git
Git introduction for Beginners
Starting with Git & GitHub
Git session 1
TMF2014 CI-CD Workshop Michael Palotas
 
Introduction to git and Github
Git hub_pptx
Introduction to Git
Promise of DevOps
Introduction to Git
EdTechJoker Spring 2020 - Lecture 2 - Git
Git and GitHub (1).pptx
True Git
Git And Git Hub.pptx
Interview preparation devops
Devops
Ad

Recently uploaded (20)

PPTX
Business Acumen Training GuidePresentation.pptx
PPTX
Moving the Public Sector (Government) to a Digital Adoption
PPTX
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
PPTX
Computer network topology notes for revision
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPTX
oil_refinery_comprehensive_20250804084928 (1).pptx
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PDF
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
PDF
Clinical guidelines as a resource for EBP(1).pdf
PDF
Launch Your Data Science Career in Kochi – 2025
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPTX
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PPTX
Database Infoormation System (DBIS).pptx
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Business Acumen Training GuidePresentation.pptx
Moving the Public Sector (Government) to a Digital Adoption
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
Computer network topology notes for revision
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
oil_refinery_comprehensive_20250804084928 (1).pptx
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
Galatica Smart Energy Infrastructure Startup Pitch Deck
Acceptance and paychological effects of mandatory extra coach I classes.pptx
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
Clinical guidelines as a resource for EBP(1).pdf
Launch Your Data Science Career in Kochi – 2025
climate analysis of Dhaka ,Banglades.pptx
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Database Infoormation System (DBIS).pptx
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Ad

CICD_1670665418.pdf

  • 1. From Zero to CI/CD Building your first CI Process Nir Koren DevOps CI/CD Team Leader, LivePerson Israel
  • 2. My challenge / goals today Each one of you will understand: What is CI / CD What is Git / GitHub and why most of the industry use it. Same goes to Apache Maven Same goes to Jenkins CI Each one of you will have: “hello-world” CI process on his/ her Laptop.
  • 3. What will we cover today? • Introduction • Introduction to CI/CD • Introduction & hands-on to Git and GitHub Basics • Introduction & hands-on to Maven Basics • Introduction & hands-on to Jenkins Basics • Connect all together
  • 4. What will we NOT cover today? We are not going to develop anything today. Not all of us comes from the same background and this not in the Workshop agenda. Containerized applications: Docker / Kubernetes Not enough time BUT it goes the same for those technologies as well. Jenkins Pipelines and Shared libs Not enough time but we will play with the pipeline in a nutshell.
  • 5. Agenda 09:00 – 10:30: Introduction to CI / CD 10:30 – 11:00: Coffee Break 11:00 – 12:30: Introduction to Git / GitHub 12:30 – 13:30: Lunch 13:30 – 15:00: Introduction to Maven 15:00 – 15:30: Coffee Break 15:30 – 17:00: Introduction to Jenkins & connect all WE WILL HAVE TO BE FLEXIBLE
  • 6. $ whoami Nir Koren, DevOps CI/CD Team Leader, LivePerson Israel Doing and implementing DevOps and CI / CD for 10+ years https://il.linkedin.com/in/nirkoren https://www.facebook.com/koren.nir @KorenNir @nir_koren
  • 7. I work for LivePerson 100% Cloud SaaS company Founded in 1995, Headquartered in NYC Public since 2000 (NASDAQ: LPSN) 1000 Employees over 14 offices 19,000 customers, 27M interactions / Month
  • 11. What is Continuous Integration? “A key software development practice where members of a team integrate their work frequently.” Martin Fowler, Continuous Integration: http://martinfowler.com/articles/continuousIntegration.html
  • 12. What is Continuous Integration? Continuous integration involves integrating early and often, in order to avoid "integration hell“
  • 13. CI / CD Main Goal Provides a rapid feedback. If a defect is introduced into the code base, it can be identified and corrected ASAP.
  • 14. Why CI/CD? • Frequent changes  Less integration problems. • Bugs are detected earlier  Saves money. • Avoid last minute chaos. • Transparency to all. • Testing on Production-Like env. • Easy to rollback in case of any issue. • Enforce of automation culture. • Enforce DevOps culture. • Make the developers accountable and take ownership.
  • 15. CI Principles • Automate the build (single command), Automate all. • Build is self testable. • Baseline branch is open consistently. • Every commit should be built. • Build should be fast. • Test Env is clone of Production (as much as we can). • Everyone can see the status – Transparency.
  • 17. Code Test Deploy Build Continuous Delivery (CD) is a software development discipline where you build software in such a way that the software can be released to production at any time. Continuous Deployment means that every change goes through the pipeline and automatically gets put into production, resulting in many production deployments every day. Continuous Delivery & Deployment
  • 18. Continuous Deployment Continuous Delivery Auto Auto Manual Build Deployment Tests Production Auto Auto Auto Build Deployment Tests Production
  • 19. CD Principles • The Software is always deployable through it’s lifecycle. • Anybody can get fast and automated state of Production. • You can perform push-button deployments any time
  • 21. CD is not only in Computer Software Tesla Model S gets firmware updates on regular basis for both UI and major elements (suspension, acceleration and more)
  • 24. Lets install git & create GitHub account Linux based: $ sudo apt-get install git Windows: Download from https://git-scm.com/ Mac: $ brew install git Or download from https://git-scm.com/ Initial configurations: $ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com Check your configurations: $ git config -l https://github.com/ Sign Up
  • 25. Git installation / configuration files. /usr/local/bin INSTALLATION DIRECTORY C:Program FilesGit ~/.gitconfig CONFIGURATION DIRECTORY CODE REPOSITORY [user] name = Nir Koren email = nirk@liveperson.com [merge] tool = p4merge … .git
  • 26. Git is an Open Source, Distributed and popular version control system. Designed for Speed and Efficiency What is Git?
  • 27. Open Source • Free • Popular • Highly contributed by the community and GitHub
  • 28. Popular • Multi-platform support • Multiple GIU’s • Fully command lined – great for CI / Automation • Contains any IDE / Integrated plugins
  • 29. Fast • Performing a diff • Viewing file history • Committing changes • Merging branches • Obtaining any other revision of a file • Switching branches • No Network needed.
  • 30. First release @ 2005 for Linux Kernel source code. New free alternative for BitKeeper. History & Founder I'm an egotistical bastard, and I name all my projects after myself. First “Linux” and now “git”. Linus Torvalds
  • 32. Key Concepts COMMIT A Snapshot in the repository State of the project in a certain time. Point of a tree BRANCH A label with user-friendly name. Point to a commit. TAG A descriptive name to a list of commits. Technically – it’s all the same
  • 33. Key Concepts REMOTE Can be origin (where it cloned from) or upstream (custom) The version that hosted in the server. Can be remote host or local clone. CLONE Copy of a repository locally on your laptop. Comes with metadata relationship to the remote repo FORK A personal copy of a repository that lives remotely on a user account and holds relationship with the original repo..
  • 34. Git: Areas Workspace Staging Repository Remote git add git commit git push git checkout Git reset <file> Git reset –hard (will do all files) git revert (will keep history) or git reflog / reset HEAD^ or reset –hard origin/master
  • 36. Perforce new products contains integration to Git
  • 37. FORGET Perforce FORGET ClearCase FORGET SVN FORGET Any VCS you know It’s much easier to teach a person who doesn’t know any VCS The best way to learn Git
  • 38. Philosophy • While SVN trunk is development, GIT Master is Release. • Anything in origin master is deployable. • Create a descriptively named branch for new feature development • Commit early and often to new branch locally • Ensure that each commit represents one idea or complete change. • Push your new branch work to the same named branch on origin
  • 40. What is GitHub? Web-based hosting service for version control using Git. The largest source code in the world
  • 41. GitHub Company • Founded in 2007. • Headquartered in San Francisco, 800+ employees • GitHub.com > 35M users, 100M Repositories • Core GitHub developers are core Git OS contributors • Cool brand (shop, merchandizing, crazy company)
  • 42. Pricing models • Free: your code is open and visible to all • Personal: your code is private and you can share. • Business (hosted): private in the cloud Github.com • Business (Enterprise): On-premise. Install and maintain on your own.
  • 43. Partial features list of WHY GITHUB?
  • 45. Both Machine and Human Code Review
  • 51. Forks model – Open Source work model
  • 52. Pull Request Tell others about your change, Let human / machine to review your code.
  • 54. Manage your tasks in Board
  • 55. Key Concepts ORGANIZATION Group of 2 or more users that typically acts like a real org / company. It administrated and contains teams, users and repos. REPOSITORY Collection of files with metadata (.git folder) that contains history, revisions etc’ COLLABORATOR A person who had read / write permissions to a repository. CONTRIBUTOR A person who contributes to a repository but has no collaborator access. Only PULL requests.
  • 59. • Make sure you have JDK8 • Ensure JAVA_HOME env var is pointed to the JDK8 • Download Maven https://maven.apache.org/download.cgi • Place (unzip / extract) the Maven somewhere and add the <MAVEN>/bin to your env var PATH • Run “mvn -v” to verify the installation Let’s install Maven first
  • 60. • In Yiddish: accumulator of knowledge • Releases 1.x: 2002, 2.x: 2005, 3.x (Current): 2009 • Successor of Apache ANT (*) • A standard way to build projects (Java mainly). • A Framework (open & extendable) What is Apache Maven?
  • 63. Maven directories structure src/main/java Application sources src/main/resources Application resources src/main/webapp Web application sources src/test/java Test sources src/test/resources Test resources
  • 64. Maven Architecture Project: src/main/java… Local Repository (~/.m2/repository) Proxy Install Deploy
  • 65. Maven Configuration General Configuration: ${maven.home}/conf/settings.xml User Configuration: ${user.home}/.m2/settings.xml <settings> <localRepository/> <interactiveMode/> <offline/> <pluginGroups/> <servers/> <mirrors/> <proxies/> <profiles/> <activeProfiles/> </settings>
  • 66. Maven it’s just a core framework for Maven Plugins
  • 67. $ mvn com.someorg.somegroup:some-name:1.0.0.0:any_goal –Dsomeproperty=xxx Maven Plugins
  • 68. Maven Built-in Plugins (partial List) clean Clean up after the build. compiler Compiles Java sources. deploy Deploy the built artifact to the remote repository. install Install the built artifact into the local repository. resources Copy the resources to the output directory for including in the JAR. surefire Run the JUnit unit tests in an isolated classloader.
  • 69. Maven Lifecycle (partial list) validate validate the project is correct and all necessary information is available. compile validate the project is correct and all necessary information is available. process-resources copy and process the resources before build test run tests using a suitable unit testing framework package Take the compiled code and package it in its distributable format install Package + put it in the local repo deploy Install + upload to the artifact repository
  • 70. Maven Versions General Structure (In LP we use 4 digits): 1.0.0.0-SNAPSHOT Major Version – Main content of a release Minor Version – Enhancements (Service Packs) Micro version – Bug fixes HotFix version – Emergency fixes Latest version – Latest version we have
  • 71. Maven SNAPSHOT Update Policy How often should we check for SNAPSHOT update? Can be configured in the settings.xml By default is “daily”. • “always” • “daily” • “interval:XXX” (in minutes) • “never” • Can be done always also via CMD with –U flag
  • 73. Maven POM Structure <project> <modelVersion>4.0.0</modelVersion> <!-- The Basics --> <groupId>...</groupId> <artifactId>...</artifactId> <version>...</version> <packaging>...</packaging> <dependencies>...</dependencies> <parent>...</parent> <dependencyManagement>...</dependencyManagement> <modules>...</modules> <properties>...</properties> <!-- Build Settings --> <build>...</build> <profiles>...</profiles> </project>
  • 74. Maven POM structure General artifact information <groupId>com.company.something</groupId> <artifactId>name-of-artifact</artifactId> <version>xxx-SNAPSHOT</version> <packaging>jar</packaging>
  • 77. Parent PARENT POM SERVICE #1 POM SERVICE #2 POM SERVICE #3 POM SERVICE #4 POM
  • 78. Multi module project • Collects all the available modules to build • Sorts the projects into the correct build order • Builds the selected projects in order <modules> <module>module1</module> <module>module2</module> <module>module3</module> </modules> Module1 Module2 Module3 Reactor (parent) Reactor POM pom.xml
  • 79. Dependency / plugin management <plugin> <groupId>com.myorg</groupId> <artifactId>myplugin</artifactId>. </plugin> Allows project authors to directly specify the versions or configuration of artifacts or plugins where there is no version / configuration. Can be overwritten in the plugin itself. <pluginManagement> <plugin> <groupId>com.myorg</groupId> <artifactId>myplugin</artifactId>. <version>1.1.1.1</version> </plugin> </pluginManagement>
  • 80. Maven Profiles Subset of elements in the POM that can be triggered in many ways. Can be defined both in the pom.xml or in the settings.xml <profiles> <profile> <id>my_profile_id</id> … </profile> </profiles> $ mvn clean install –Pmy_profile_id
  • 86. • Download Jenkins (Preferred LTS) https://jenkins.io/ • Open up a terminal in the download directory. • Run java -jar jenkins.war --httpPort=9090. • Browse to http://localhost:9090. • Follow the instructions to complete the installation. Docker? $ docker run -d -p 9090:8080 -u root -v /Users/nirk/jenkins_home:/var/jenkins_home jenkins/jenkins:lts Let’s install Jenkins first
  • 87. Jenkins is open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software. Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed. What is Jenkins?
  • 88. • Funded by Kohsuke Kawaguchi as Hudson CI (in that time he was a developer in Sun Microsystems). • First Hudson release was in 2004. • Oracle acquired Sun in 2010 and claimed the right to the ”Hudson” name and applied for a trademark in December 2010. • Kohsuke forked Hudson open source and created the name “Jenkins” – the rest is history. History of Jenkins
  • 89. Why Jenkins? A platform, Free, Open source. Easy to install and easy to use
  • 90. Provides built-in Authentication & Authorization Login Jenkins Server LDAP GITHUB User base SAML IDP Local User base Authorization Rules
  • 91. Open platform JSON API XML API 1000+ plugins
  • 92. Extendable Write your own plugin Support Groovy DSL Groovy declarative pipelines
  • 93. Popular by the community