SlideShare a Scribd company logo
1 of 31
Continuous Deployment Pipeline
         with Maven
          Alan Parkinson
         @alan_parkinson
Summary


• What is the Deployment Pipeline

• How can we structure maven projects for it

• The obstructions Maven causes

• Solutions to these obstructions
The release day sum
Every 2 weeks…
                                 1 Binary for ….
                 4 Significant product versions
                 5 Different database products
                    Multi Web browsers… IE7+

                        Release day headache!
The Solution: Continuous Delivery
• Eating our own dog food
• List of available release ready candidates
• One click delivery to customers

• The Toolbox:
  – Continuous Integration (CI)
  – Automated Testing : Unit + Functional
  – Continuous Deployment
Deployment Pipeline



Compile   Integration   Acceptance   Performance   Release
Why don’t we rebuild the Artifact?

    Source Code + Configuration
        + Build Environment

            = Artifact
Maven - Love it! or Hate it!

People hate maven for several reasons….

        Convention over Configuration
              == Opinionated
Fitting everything in a Maven Project
• Each stage has a set of tests
  unit, integration, functional, performance, etc…
• Developer Requirements for the build:
  – One Project
  – Sensible Default build
  – Anyone can run any test stage
Maven Project - Parent

        Library
                             Multi Module
        Library
                             Project is our
       Product
                               friend….
       tests

               database      Each test stage
               integration
                              gets its own
                                module
               acceptance
Maven Project - Parent        Sensible Default
        Library
                             …
        Library
                             <modules>
       Product                   <module>Library1</module>
       tests                     <module>Library2</module>
               database          <module>Product</module>
                             </modules>
               integration
                             …
               acceptance
Maven Project - Parent           Run everything
        Library
                             …
        Library              <profile>
                                 <id>full</id>
       Product
                                   <modules>
       tests
                             <module>tests/database</module>
               database      <module>tests/integration</module>
                             <module>tests/acceptance</module>
               integration
                                   <modules>

               acceptance
                             </profile>
                             …
Maven Project - Parent

        Library
                             …
        Library              <profile>
                                 <id>integration</id>
       Product
                                   <modules>
       tests
                              <module>tests/integration</module>
               database            <modules>
                             </profile>
               integration
                             …

               acceptance
Developer Workstation
$ mvn install

$ mvn install -Pfull

$ mvn install -Pintegration
Deployment Pipeline + Maven

                      $ cd test/integration
$ mvn install         $ mvn install


   Compile      Database      Integration   Acceptance       Release




         $ cd test/database           $ cd test/acceptance
         $ mvn install                $ mvn install
Maven’s Opinion: Artifact releases
• Artifact’s have two states:
  – Released
  – SNAPSHOT


• Releases are expected to be immutable
• Snapshots are temporal
• No release candidate concept
Distributed builds and Artifacts

                                Maven
                              Repository




   Compile      Integration   Acceptance   Performance   Release



$ mvn install
$ mvn deploy
Commit: r103


  Compile      Integration   Acceptance   Performance   Release




Commit: r102

   Compile     Integration   Acceptance   Performance   Release




Commit: r101

  Compile      Integration   Acceptance   Performance   Release
Avoiding Snapshots

Each build needs a unique version
             number
Release Plugin – Part 1
mvn release:prepare
  1. Build
  2. Update POM to release version
  3. Commit and Tag release in SCM
  4. Update POM to next snapshot
     version
  5. Commit to SCM
Release Plugin – Part 2

mvn release:perform
  1. Checkout release tag from SCM
  2. Build
  3. Deploy
Maven headaches
• Can’t use the Release plugin
• Each build/release candidate should be
  release ready
• Simulate the Release Plugin
Version number rules

<Major [> . <Minor [> . <Inc ] ] > - <Build ]>

1
1.1
1.0.1
1.0.0-45
1.0-45
Sources for the Build qualifier
• What does your CI System Provide?
  – Build Numbers
  – SCM Revision Numbers

• Value with natural ordering
  – Subversion revision is good
  – GIT SHA don’t help us

• Combine values:      r2964b45
Simulating a Release
• Set a version without SNAPSHOT
• Use the handy Versions Plugin

Setting the project version can be done from the
                 command line
$ mvn versions:set
-DnewVersion=
${product.version}-${bamboo.buildNumber}

product.version = 1.0.1
bamboo.buildNumber = 45
1.0.1-45
Add to the parent POM
<plugin>
  <group>org.codehaus.mojo</group>
  <artifact>versions-maven-plugin</artifact>
  <version>1.3.1</version>
</plugin>
$ mvn set –DnewVersion=…
                    $ cd test/integration
                    $ mvn install
$ mvn set –DnewVersion=…
$ mvn deploy


   Compile    Database     Integration   Acceptance   Release



    $ mvn set –DnewVersion=…
    $ cd test/database
    $ mvn install
                           $ mvn set –DnewVersion=…
                           $ cd test/acceptance
                           $ mvn install
Summary
•   Don’t rebuild the Artifact in each stage
•   Don’t use Snapshots
•   Assign Unique Versions to each build
•   Keep the project architecture simple
Thank you

          Alan Parkinson
alan.parkinson@hindsightsoftware.co.uk
            @alan_parkinson
Continuous Deployment
• Maven weaknesses
• Cheat
  – Delegate to CI Tasks or Scripts
Maven Repositories
• Simple
  – HTTP Server + SSH/SCP access
  – Amazon S3
• Dedicated
  – Nexus
  – Artifactory

More Related Content

What's hot

Maven for Dummies
Maven for DummiesMaven for Dummies
Maven for DummiesTomer Gabel
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to MavenVadym Lotar
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenGeert Pante
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1MD Sayem Ahmed
 
Introduction to Apache Maven
Introduction to Apache MavenIntroduction to Apache Maven
Introduction to Apache MavenRajind Ruparathna
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - ExplainedSmita Prasad
 
Using Maven 2
Using Maven 2Using Maven 2
Using Maven 2andyhot
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 OverviewMike Ensor
 
Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01rhemsolutions
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with MavenSid Anand
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 featuresAngel Ruiz
 

What's hot (20)

Maven for Dummies
Maven for DummiesMaven for Dummies
Maven for Dummies
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1
 
Maven basics
Maven basicsMaven basics
Maven basics
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Apache Maven In 10 Slides
Apache Maven In 10 SlidesApache Maven In 10 Slides
Apache Maven In 10 Slides
 
Introduction to Apache Maven
Introduction to Apache MavenIntroduction to Apache Maven
Introduction to Apache Maven
 
Maven ppt
Maven pptMaven ppt
Maven ppt
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
Maven Overview
Maven OverviewMaven Overview
Maven Overview
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
 
Using Maven 2
Using Maven 2Using Maven 2
Using Maven 2
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 
Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
 
Maven
Maven Maven
Maven
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
 
Apache maven 2 overview
Apache maven 2 overviewApache maven 2 overview
Apache maven 2 overview
 

Similar to Continuous Deployment Pipeline with maven

How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.Fazreil Amreen Abdul Jalil
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsSISTechnologies
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenMert Çalışkan
 
Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by ExampleHsi-Kai Wang
 
Jdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent ProjectsJdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent ProjectsMert Çalışkan
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management toolRenato Primavera
 
Developing Liferay Plugins with Maven
Developing Liferay Plugins with MavenDeveloping Liferay Plugins with Maven
Developing Liferay Plugins with MavenMika Koivisto
 
Introduction tomaven
Introduction tomavenIntroduction tomaven
Introduction tomavenManav Prasad
 
Introduction To Maven2
Introduction To Maven2Introduction To Maven2
Introduction To Maven2Shuji Watanabe
 
Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldDmitry Bakaleinik
 
Embrace Maven
Embrace MavenEmbrace Maven
Embrace MavenGuy Marom
 

Similar to Continuous Deployment Pipeline with maven (20)

How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOps
 
Apache Maven 2 Part 2
Apache Maven 2 Part 2Apache Maven 2 Part 2
Apache Maven 2 Part 2
 
Maven
MavenMaven
Maven
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by Example
 
Releasing Projects Using Maven
Releasing Projects Using MavenReleasing Projects Using Maven
Releasing Projects Using Maven
 
4 maven junit
4 maven junit4 maven junit
4 maven junit
 
Jdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent ProjectsJdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent Projects
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management tool
 
Developing Liferay Plugins with Maven
Developing Liferay Plugins with MavenDeveloping Liferay Plugins with Maven
Developing Liferay Plugins with Maven
 
Introduction tomaven
Introduction tomavenIntroduction tomaven
Introduction tomaven
 
Maven advanced
Maven advancedMaven advanced
Maven advanced
 
Maven
MavenMaven
Maven
 
Apache Maven for AT/QC
Apache Maven for AT/QCApache Maven for AT/QC
Apache Maven for AT/QC
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
 
Introduction To Maven2
Introduction To Maven2Introduction To Maven2
Introduction To Maven2
 
Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS world
 
Embrace Maven
Embrace MavenEmbrace Maven
Embrace Maven
 

More from Alan Parkinson

Test Data Builder Pattern
Test Data Builder PatternTest Data Builder Pattern
Test Data Builder PatternAlan Parkinson
 
Testing requirements with BDD
Testing requirements with BDDTesting requirements with BDD
Testing requirements with BDDAlan Parkinson
 
Baking in the cloud with packer and puppet
Baking in the cloud with packer and puppetBaking in the cloud with packer and puppet
Baking in the cloud with packer and puppetAlan Parkinson
 
Decapitating Selenium with JavaScript
Decapitating Selenium with JavaScriptDecapitating Selenium with JavaScript
Decapitating Selenium with JavaScriptAlan Parkinson
 
Pull requests and testers can be friends
Pull requests and testers can be friendsPull requests and testers can be friends
Pull requests and testers can be friendsAlan Parkinson
 
What is Continuous Delivery?
What is Continuous Delivery?What is Continuous Delivery?
What is Continuous Delivery?Alan Parkinson
 
Cross browser Testing JavaScript
Cross browser Testing JavaScriptCross browser Testing JavaScript
Cross browser Testing JavaScriptAlan Parkinson
 
Why we used Feature Branching
Why we used Feature BranchingWhy we used Feature Branching
Why we used Feature BranchingAlan Parkinson
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVMAlan Parkinson
 
A Quick overview of Behaviour Driven Development (BDD)
A Quick overview of Behaviour Driven Development (BDD)A Quick overview of Behaviour Driven Development (BDD)
A Quick overview of Behaviour Driven Development (BDD)Alan Parkinson
 
Cross-browser unit testing JavaScript
Cross-browser unit testing JavaScriptCross-browser unit testing JavaScript
Cross-browser unit testing JavaScriptAlan Parkinson
 
Creating data with the test data builder pattern
Creating data with the test data builder patternCreating data with the test data builder pattern
Creating data with the test data builder patternAlan Parkinson
 
Acceptance test styles - Imperative vs Declarative
Acceptance test styles - Imperative vs DeclarativeAcceptance test styles - Imperative vs Declarative
Acceptance test styles - Imperative vs DeclarativeAlan Parkinson
 
Feature branching a release day painkiller
Feature branching   a release day painkillerFeature branching   a release day painkiller
Feature branching a release day painkillerAlan Parkinson
 

More from Alan Parkinson (14)

Test Data Builder Pattern
Test Data Builder PatternTest Data Builder Pattern
Test Data Builder Pattern
 
Testing requirements with BDD
Testing requirements with BDDTesting requirements with BDD
Testing requirements with BDD
 
Baking in the cloud with packer and puppet
Baking in the cloud with packer and puppetBaking in the cloud with packer and puppet
Baking in the cloud with packer and puppet
 
Decapitating Selenium with JavaScript
Decapitating Selenium with JavaScriptDecapitating Selenium with JavaScript
Decapitating Selenium with JavaScript
 
Pull requests and testers can be friends
Pull requests and testers can be friendsPull requests and testers can be friends
Pull requests and testers can be friends
 
What is Continuous Delivery?
What is Continuous Delivery?What is Continuous Delivery?
What is Continuous Delivery?
 
Cross browser Testing JavaScript
Cross browser Testing JavaScriptCross browser Testing JavaScript
Cross browser Testing JavaScript
 
Why we used Feature Branching
Why we used Feature BranchingWhy we used Feature Branching
Why we used Feature Branching
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVM
 
A Quick overview of Behaviour Driven Development (BDD)
A Quick overview of Behaviour Driven Development (BDD)A Quick overview of Behaviour Driven Development (BDD)
A Quick overview of Behaviour Driven Development (BDD)
 
Cross-browser unit testing JavaScript
Cross-browser unit testing JavaScriptCross-browser unit testing JavaScript
Cross-browser unit testing JavaScript
 
Creating data with the test data builder pattern
Creating data with the test data builder patternCreating data with the test data builder pattern
Creating data with the test data builder pattern
 
Acceptance test styles - Imperative vs Declarative
Acceptance test styles - Imperative vs DeclarativeAcceptance test styles - Imperative vs Declarative
Acceptance test styles - Imperative vs Declarative
 
Feature branching a release day painkiller
Feature branching   a release day painkillerFeature branching   a release day painkiller
Feature branching a release day painkiller
 

Recently uploaded

Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Continuous Deployment Pipeline with maven

  • 1. Continuous Deployment Pipeline with Maven Alan Parkinson @alan_parkinson
  • 2. Summary • What is the Deployment Pipeline • How can we structure maven projects for it • The obstructions Maven causes • Solutions to these obstructions
  • 3. The release day sum Every 2 weeks… 1 Binary for …. 4 Significant product versions 5 Different database products Multi Web browsers… IE7+ Release day headache!
  • 4. The Solution: Continuous Delivery • Eating our own dog food • List of available release ready candidates • One click delivery to customers • The Toolbox: – Continuous Integration (CI) – Automated Testing : Unit + Functional – Continuous Deployment
  • 5. Deployment Pipeline Compile Integration Acceptance Performance Release
  • 6. Why don’t we rebuild the Artifact? Source Code + Configuration + Build Environment = Artifact
  • 7. Maven - Love it! or Hate it! People hate maven for several reasons…. Convention over Configuration == Opinionated
  • 8. Fitting everything in a Maven Project • Each stage has a set of tests unit, integration, functional, performance, etc… • Developer Requirements for the build: – One Project – Sensible Default build – Anyone can run any test stage
  • 9. Maven Project - Parent Library Multi Module Library Project is our Product friend…. tests database Each test stage integration gets its own module acceptance
  • 10. Maven Project - Parent Sensible Default Library … Library <modules> Product <module>Library1</module> tests <module>Library2</module> database <module>Product</module> </modules> integration … acceptance
  • 11. Maven Project - Parent Run everything Library … Library <profile> <id>full</id> Product <modules> tests <module>tests/database</module> database <module>tests/integration</module> <module>tests/acceptance</module> integration <modules> acceptance </profile> …
  • 12. Maven Project - Parent Library … Library <profile> <id>integration</id> Product <modules> tests <module>tests/integration</module> database <modules> </profile> integration … acceptance
  • 13. Developer Workstation $ mvn install $ mvn install -Pfull $ mvn install -Pintegration
  • 14. Deployment Pipeline + Maven $ cd test/integration $ mvn install $ mvn install Compile Database Integration Acceptance Release $ cd test/database $ cd test/acceptance $ mvn install $ mvn install
  • 15. Maven’s Opinion: Artifact releases • Artifact’s have two states: – Released – SNAPSHOT • Releases are expected to be immutable • Snapshots are temporal • No release candidate concept
  • 16. Distributed builds and Artifacts Maven Repository Compile Integration Acceptance Performance Release $ mvn install $ mvn deploy
  • 17. Commit: r103 Compile Integration Acceptance Performance Release Commit: r102 Compile Integration Acceptance Performance Release Commit: r101 Compile Integration Acceptance Performance Release
  • 18. Avoiding Snapshots Each build needs a unique version number
  • 19. Release Plugin – Part 1 mvn release:prepare 1. Build 2. Update POM to release version 3. Commit and Tag release in SCM 4. Update POM to next snapshot version 5. Commit to SCM
  • 20. Release Plugin – Part 2 mvn release:perform 1. Checkout release tag from SCM 2. Build 3. Deploy
  • 21. Maven headaches • Can’t use the Release plugin • Each build/release candidate should be release ready • Simulate the Release Plugin
  • 22. Version number rules <Major [> . <Minor [> . <Inc ] ] > - <Build ]> 1 1.1 1.0.1 1.0.0-45 1.0-45
  • 23. Sources for the Build qualifier • What does your CI System Provide? – Build Numbers – SCM Revision Numbers • Value with natural ordering – Subversion revision is good – GIT SHA don’t help us • Combine values: r2964b45
  • 24. Simulating a Release • Set a version without SNAPSHOT • Use the handy Versions Plugin Setting the project version can be done from the command line
  • 26. Add to the parent POM <plugin> <group>org.codehaus.mojo</group> <artifact>versions-maven-plugin</artifact> <version>1.3.1</version> </plugin>
  • 27. $ mvn set –DnewVersion=… $ cd test/integration $ mvn install $ mvn set –DnewVersion=… $ mvn deploy Compile Database Integration Acceptance Release $ mvn set –DnewVersion=… $ cd test/database $ mvn install $ mvn set –DnewVersion=… $ cd test/acceptance $ mvn install
  • 28. Summary • Don’t rebuild the Artifact in each stage • Don’t use Snapshots • Assign Unique Versions to each build • Keep the project architecture simple
  • 29. Thank you Alan Parkinson alan.parkinson@hindsightsoftware.co.uk @alan_parkinson
  • 30. Continuous Deployment • Maven weaknesses • Cheat – Delegate to CI Tasks or Scripts
  • 31. Maven Repositories • Simple – HTTP Server + SSH/SCP access – Amazon S3 • Dedicated – Nexus – Artifactory

Editor's Notes

  1. Scrum like process2 week iterationUsers stories don’t always get completed in timeBut we still release on time, but with out incomplete work1 Binary for ….4 Significant product versions – API and UI Changes 5 Different database vendors – SQL compatible and Database Upgrade Multi Web browsers… IE7+
  2. Pattern language for improving the process of Software DeliveryIts aims to produce Rapid, reliable and repeatable delivery of software with the minimal human intervention.It does this by leveraging existing techniques like Automated Testing, Continuous Integration and Continuous Deployment.CI Who’s already using CI?Why aren’t you using it? Don’t try Continuous DeploymentReliable and repeatable deployment of software to servers. These could be production QA staging serversCould be scripts for deploying to J2EE Containers
  3. Continuous Delivery Book by Jez Humble and Dave FarleyThe core concept in the CD Pattern is the Deployment Pipeline.A series of “Stages” starting at creating your Artifact at the first stage and Releasing it in the final stage.Artifact is known as a release candidateThe stages in between are quality gates, is the Artifact good enough to be releasedWe don’t rebuild the artifact, we pass it. We will discuss this in a momentTypically constructed using Continuous Integration servers like Jenkins, Hudson, Bamboo or TeamCity. Each stage could be one or CI jobs joined to together to from the pipeline.Manual Break in the pipeline – QA Staging and manual approvalReleasing in case of a SAAS product would be deploying and rolling it out live to customers.You can define what release meansOur definition is the Artifact is made available to customers for downloading and customers are notified about the release.
  4. Slows down the build 18 jobs – 17 minsDoes every machine produce the same artifact?Buggy compiler/JDKMaven global settings file can apply Maven profiles secretly
  5. I should have reason to hate maven in this caseThe release Day headache was partly caused by MavenI had to find the correct commit within GIT that we wanted to releaseThen run the release plugin on it. This violated my earlier principle of rebuilding the Artifact
  6. Lets get on with first goal
  7. The SNAPSHOT extension gets converted into a timestamp when deploy to a Maven repo We can not convert a SNAPSHOT Artifact to RELEASE
  8. Another Example of Snapshots can’t be usedThink about distributed build setupAnd concurrent executions of the pipeline – Next slide
  9. Artifact build in the compile stage should be considered a “release” version in maven.
  10. Release Plugin a stage two processRelease:prepareRelease:perform
  11. Can’t use Release plugin – It redoes everythingWe don’t want to “tag” a version at the start of the pipeline, only at the end when all gates have been passedHow can we get a unique version number for our builds? Look at the rules for version numbers
  12. CI systems expose a number of variables in our CI Jobs which we can access using variable subsuitationBETA1, BETA2Git SHA is not a good qualifierPrefer using Build number – What happens if someone triggers the pipeline manually?
  13. This gives you a basic functional pipeline