SlideShare una empresa de Scribd logo
1 de 32
How to push to production a
project with 100+ plugins in
less than 10 minutes
Thiago Moreira
Senior Consultant @ Liferay Brazil
Agenda


•   Motivation
•   About the project
•   Script workflow
•   Benefits
•   Challenges
•   References
•   Future
Motivation (1/2)



Back in 2010 I was working in another consulting project and
we were getting ready to push to production a new version of
an intranet based on Social Office when I had the following
phone talk with Michael Han
Motivation (2/2)


• Thiago: Hey mike, I have to say that I’m confortable with
the project implementation but I’m a little worried about the
task of push to production… (waiting a response like: don’t
worry everything will be fine)
• Mike: Thiago, something will go wrong! The thing is, you
have to be ready to fix it.
• Thiago: Oh man!
About the project (1/5)
• 1 ext
• 4 layout templates
• 121 portlets (21 projects with 1 portlet and 1 project with
100 portlets
• 12 hooks
• 6 themes
• 4 webs

• Total 148 plugins.
About the project (2/5)
•   4 Production server in cluster
•   1 QA server
•   0 Development server
•   1 Jenkins server
•   1 Nexus server (shared with Jenkins)
•   Github as source code server
About the project (3/5)

       Tomcat and            Deployment
         Liferay           host, deployment
         bundles           user, application
                              user, JVM
                             settings, etc
         Liferay
      Environment
         Liferay
        patches
        profiles
         plugins


                            Properties
                               files

             Main script
About the project (4/5)
• 3 Jenkins jobs were configured to each of the 3 branches
on git.
   • Master -> development (every push to upstream)
   • QA (homologacao) -> QA (every day at 7:00 am)
   • Production -> production (push of a button)
About the project (5/5)

                       Production
                      Environment




           QA                       Development
       Environment   Jenkins        Environment
Script Workflow


  Check        Build      Build
Environment   Liferay   Application




   Clean
               Build    Configure      Deploy to
              Tomcat     Tomcat       environment
Script Workflow
Check environment


•   It is used to check if the environment is correct
    1. It checks if the developer set the target.environment
         variable
    2. It checks if the environment has the correct Ant version
         (configurable)
    3. It checks if the environment has the correct Maven
         version (configurable)
Script Workflow
Clean




1. It is used to clean the main build directory e.g. the target
 directory.
Script Workflow
Build Tomcat
1. Unpack a vanilla Tomcat from the
 ${basedir}/src/main/bundle directory to ${basedir}/target




1. Delete all webapps’ directory content
2. Delete all *.bat files from bin directory
3. Set execution permission on *.sh files from bin directory
Script Workflow
Build Liferay


1. Unpacks the ${basedir}/src/main/bundles/liferay-
 version.war to ${tomcat}/webapps/ROOT
2. Unpacks the ${basedir}/src/main/bundles/liferay-
 dependencies-version.zip to ${tomcat}/lib
3. Install and configure the patching-tool-4.zip into the right
 place (liferay home)
4. Copy the license to the deploy directory
Script Workflow
Build Application (1/2)
1. Build and direct-deploy the ext project Ant based
2. Call Maven to build the other projects
   • The sequence of build is defined at the pom.xml and it is
      • commons
      • webs
      • layouttpl
      • themes
      • hooks
      • portlets
Build Application (2/2)
                          Avoid Liferay to deploy
                          the plugins on startup
                              (cold deploy)
3. Call direct-deploy on each of the projects built by Maven
4. Copy the patches to the patching-tool home
5. Copy plugins (downloaded from liferay.com) to deploy
 directory
Script Workflow
Configure Tomcat (1/2)
Worker-Name
1. Creates a MANIFEST.MF file with set a properties that
 identifies the current build            Can be accessed
                                              thought
                                        www.domain.com/html
                                          /environment.txt




2. Configure portal-ext.properties with environment
   properties
3. Configure server.xml with environment properties
Configure Tomcat (2/2)
Worker-Name
4. Configure setenv.sh with the proper TOMCAT_HOME and
   CATALINA_OPTS
Script Workflow
Deploy to environment (1/2)
1. Pack a tgz bundle with everything built
2. Shutdown the remote Tomcat
3. Remotely remove the old Liferay
4. Copy the bundle to the remote machine
5. Unpack the bundle
6. Change the ownership of liferay home to the application
 user and group
7. Configure *.sh to be runnable
8. Apply the patches
9. Start the remote Tomcat
10. Wait 90 seconds (configurable) until start the next node
Deploy to environment (2/2)
Benefits
• We use the same script to build and deploy on developers
machine as well QA and Production boxes. This ensure that
the script is validated several times before run on production.
• The whole process does not take more than 10 minutes to
finish on any environment.



• We are able to rollback the version in production within a
few minutes
Challenges
• Upgrade the version of Liferay from 6.0.11 to 6.0.12
• Push changes that affects the database
• If needed put the production environment in maintenance
automatically through script.
• Test cluster configuration directly on production
References
• Continuous Delivery: Reliable Software Releases Through
Build, Test, And Deployment Automation by Jez Humble and
David Farley
Future
• Short term
  • Add jsp pre-compilation
  • Replace the direct-deploy Ant task per a Maven goal
  • Use a sudo user to remote deploy instead of root
• Middle term
  • Move the infra structure to a PaaS (Cloudbees)
  • Script the process of update and restart the web server
    when needed
• Long term
  • Create a Maven plugin to replace the Ant script
Thank you!




                 thiago.moreira@liferay.com

tmoreira2020 @ facebook | linkedin | plus | slideshare | twitter

   Don’t forget to rate the presentation on our mobile app!

Más contenido relacionado

La actualidad más candente

CIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterCIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterAndrii Podanenko
 
Drupal contrib module maintaining
Drupal contrib module maintainingDrupal contrib module maintaining
Drupal contrib module maintainingAndrii Podanenko
 
Hudson: Your robotic butler
Hudson: Your robotic butlerHudson: Your robotic butler
Hudson: Your robotic butlerSteven Merrill
 
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with JenkinsCLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with JenkinsZachary Stevens
 
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/HudsonEclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/HudsonVladLica
 
Continuous Integration (Jenkins/Hudson)
Continuous Integration (Jenkins/Hudson)Continuous Integration (Jenkins/Hudson)
Continuous Integration (Jenkins/Hudson)Dennys Hsieh
 
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data Projects
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data ProjectsJUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data Projects
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data ProjectsCloudBees
 
Testing for infra code using test-kitchen,docker,chef
Testing for infra code using  test-kitchen,docker,chefTesting for infra code using  test-kitchen,docker,chef
Testing for infra code using test-kitchen,docker,chefkamalikamj
 
JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"
JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"
JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"CloudBees
 
Best Practices for Mission-Critical Jenkins
Best Practices for Mission-Critical JenkinsBest Practices for Mission-Critical Jenkins
Best Practices for Mission-Critical Jenkinsmrooney7828
 
Continuous Delivery with Jenkins Workflow
Continuous Delivery with Jenkins WorkflowContinuous Delivery with Jenkins Workflow
Continuous Delivery with Jenkins WorkflowUdaypal Aarkoti
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Puppet
 
Introduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with JenkinsIntroduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with JenkinsBrice Argenson
 
How to successfully migrate to Bazel from Maven or Gradle - Riga Dev Days
How to successfully migrate to Bazel from Maven or Gradle - Riga Dev DaysHow to successfully migrate to Bazel from Maven or Gradle - Riga Dev Days
How to successfully migrate to Bazel from Maven or Gradle - Riga Dev DaysNatan Silnitsky
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins worldBrent Laster
 
Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Andrii Podanenko
 
Live deployment, ci, drupal
Live deployment, ci, drupalLive deployment, ci, drupal
Live deployment, ci, drupalAndrii Podanenko
 

La actualidad más candente (20)

CIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterCIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops better
 
Drupal contrib module maintaining
Drupal contrib module maintainingDrupal contrib module maintaining
Drupal contrib module maintaining
 
Hudson: Your robotic butler
Hudson: Your robotic butlerHudson: Your robotic butler
Hudson: Your robotic butler
 
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with JenkinsCLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
 
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/HudsonEclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
 
Continuous Integration (Jenkins/Hudson)
Continuous Integration (Jenkins/Hudson)Continuous Integration (Jenkins/Hudson)
Continuous Integration (Jenkins/Hudson)
 
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data Projects
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data ProjectsJUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data Projects
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data Projects
 
Testing for infra code using test-kitchen,docker,chef
Testing for infra code using  test-kitchen,docker,chefTesting for infra code using  test-kitchen,docker,chef
Testing for infra code using test-kitchen,docker,chef
 
JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"
JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"
JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
Best Practices for Mission-Critical Jenkins
Best Practices for Mission-Critical JenkinsBest Practices for Mission-Critical Jenkins
Best Practices for Mission-Critical Jenkins
 
Continuous Delivery with Jenkins Workflow
Continuous Delivery with Jenkins WorkflowContinuous Delivery with Jenkins Workflow
Continuous Delivery with Jenkins Workflow
 
Jenkins pipeline as code
Jenkins pipeline as codeJenkins pipeline as code
Jenkins pipeline as code
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
Introduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with JenkinsIntroduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with Jenkins
 
How to successfully migrate to Bazel from Maven or Gradle - Riga Dev Days
How to successfully migrate to Bazel from Maven or Gradle - Riga Dev DaysHow to successfully migrate to Bazel from Maven or Gradle - Riga Dev Days
How to successfully migrate to Bazel from Maven or Gradle - Riga Dev Days
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins world
 
Maven2交流
Maven2交流Maven2交流
Maven2交流
 
Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.
 
Live deployment, ci, drupal
Live deployment, ci, drupalLive deployment, ci, drupal
Live deployment, ci, drupal
 

Destacado

Benefits of using liferay
Benefits of using liferay Benefits of using liferay
Benefits of using liferay SKALI Group
 
Liferay portal – moving beyond content management
Liferay portal – moving beyond content managementLiferay portal – moving beyond content management
Liferay portal – moving beyond content managementAmbientia
 
Moved to https://slidr.io/azzazzel/liferay-7-microservices-for-the-enterprise
Moved to https://slidr.io/azzazzel/liferay-7-microservices-for-the-enterpriseMoved to https://slidr.io/azzazzel/liferay-7-microservices-for-the-enterprise
Moved to https://slidr.io/azzazzel/liferay-7-microservices-for-the-enterpriseMilen Dyankov
 
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiRafik HARABI
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projectsIBACZ
 
Liferay overview
Liferay overviewLiferay overview
Liferay overviewAbhishekSRC
 
Liferay architecture By Navin Agarwal
Liferay architecture By Navin AgarwalLiferay architecture By Navin Agarwal
Liferay architecture By Navin AgarwalNavin Agarwal
 
Liferay Portal Introduction
Liferay Portal IntroductionLiferay Portal Introduction
Liferay Portal IntroductionNguyen Tung
 
Présentation LifeRay
Présentation LifeRayPrésentation LifeRay
Présentation LifeRayf.morin
 

Destacado (16)

Dev-Time Liferay
Dev-Time  LiferayDev-Time  Liferay
Dev-Time Liferay
 
Benefits of using liferay
Benefits of using liferay Benefits of using liferay
Benefits of using liferay
 
Liferay 6 and vaadin portlets
Liferay 6 and vaadin portletsLiferay 6 and vaadin portlets
Liferay 6 and vaadin portlets
 
Why choose-liferay
Why choose-liferayWhy choose-liferay
Why choose-liferay
 
Liferay portal advantages
Liferay portal advantagesLiferay portal advantages
Liferay portal advantages
 
Liferay portal – moving beyond content management
Liferay portal – moving beyond content managementLiferay portal – moving beyond content management
Liferay portal – moving beyond content management
 
Making a decision between Liferay and Drupal
Making a decision between Liferay and DrupalMaking a decision between Liferay and Drupal
Making a decision between Liferay and Drupal
 
Moved to https://slidr.io/azzazzel/liferay-7-microservices-for-the-enterprise
Moved to https://slidr.io/azzazzel/liferay-7-microservices-for-the-enterpriseMoved to https://slidr.io/azzazzel/liferay-7-microservices-for-the-enterprise
Moved to https://slidr.io/azzazzel/liferay-7-microservices-for-the-enterprise
 
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
 
Overview of Liferay 7 Technology
Overview of Liferay 7 TechnologyOverview of Liferay 7 Technology
Overview of Liferay 7 Technology
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projects
 
Liferay overview
Liferay overviewLiferay overview
Liferay overview
 
Liferay
LiferayLiferay
Liferay
 
Liferay architecture By Navin Agarwal
Liferay architecture By Navin AgarwalLiferay architecture By Navin Agarwal
Liferay architecture By Navin Agarwal
 
Liferay Portal Introduction
Liferay Portal IntroductionLiferay Portal Introduction
Liferay Portal Introduction
 
Présentation LifeRay
Présentation LifeRayPrésentation LifeRay
Présentation LifeRay
 

Similar a How to push to production a project with 100+ plugins in less than 10 minutes

Maven and j unit introduction
Maven and j unit introductionMaven and j unit introduction
Maven and j unit introductionSergii Fesenko
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversionMangesh Bhujbal
 
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow v6 Training Slides - 16 - Preparing Development EnvironmentJoget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow v6 Training Slides - 16 - Preparing Development EnvironmentJoget Workflow
 
Source control - what you need to know
Source control - what you need to knowSource control - what you need to know
Source control - what you need to knowdaveymni
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack SummitMiguel Zuniga
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOpsEklove Mohan
 
Build Tools & Maven
Build Tools & MavenBuild Tools & Maven
Build Tools & MavenDavid Simons
 
Java build tools
Java build toolsJava build tools
Java build toolsSujit Kumar
 
Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019graemerocher
 
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...Joget Workflow
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITPouriaQashqai1
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal infoSynapseindiappsdevelopment
 
Automatize everything
Automatize everythingAutomatize everything
Automatize everythingBoris Bucha
 
Maven TestNg frame work (1) (1)
Maven TestNg frame work (1) (1)Maven TestNg frame work (1) (1)
Maven TestNg frame work (1) (1)Gopi Raghavendra
 
Continuous Delivery with Sitecore
Continuous Delivery with SitecoreContinuous Delivery with Sitecore
Continuous Delivery with SitecoreCode Computerlove
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC DeploymentsSujit Kumar
 

Similar a How to push to production a project with 100+ plugins in less than 10 minutes (20)

Maven and j unit introduction
Maven and j unit introductionMaven and j unit introduction
Maven and j unit introduction
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversion
 
Devops.pptx
Devops.pptxDevops.pptx
Devops.pptx
 
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow v6 Training Slides - 16 - Preparing Development EnvironmentJoget Workflow v6 Training Slides - 16 - Preparing Development Environment
Joget Workflow v6 Training Slides - 16 - Preparing Development Environment
 
Source control - what you need to know
Source control - what you need to knowSource control - what you need to know
Source control - what you need to know
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack Summit
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
Build Tools & Maven
Build Tools & MavenBuild Tools & Maven
Build Tools & Maven
 
Jenkins Tutorial.pdf
Jenkins Tutorial.pdfJenkins Tutorial.pdf
Jenkins Tutorial.pdf
 
Java build tools
Java build toolsJava build tools
Java build tools
 
Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019
 
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
Joget Workflow v5 Training Slides - Module 16 - Preparing Development Environ...
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
Devops
DevopsDevops
Devops
 
CV_RishabhDixit
CV_RishabhDixitCV_RishabhDixit
CV_RishabhDixit
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
 
Automatize everything
Automatize everythingAutomatize everything
Automatize everything
 
Maven TestNg frame work (1) (1)
Maven TestNg frame work (1) (1)Maven TestNg frame work (1) (1)
Maven TestNg frame work (1) (1)
 
Continuous Delivery with Sitecore
Continuous Delivery with SitecoreContinuous Delivery with Sitecore
Continuous Delivery with Sitecore
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC Deployments
 

Más de Thiago Leão Moreira

Más de Thiago Leão Moreira (8)

Liferay DEVCON 2023 - What's cooking in Liferay's Cloud?
Liferay DEVCON 2023 - What's cooking in Liferay's Cloud?Liferay DEVCON 2023 - What's cooking in Liferay's Cloud?
Liferay DEVCON 2023 - What's cooking in Liferay's Cloud?
 
Unit test your *LocalServiceImpl classes
Unit test your *LocalServiceImpl classesUnit test your *LocalServiceImpl classes
Unit test your *LocalServiceImpl classes
 
Novidades do Liferay Portal 6.2
Novidades do Liferay Portal 6.2Novidades do Liferay Portal 6.2
Novidades do Liferay Portal 6.2
 
Novas Funcionalidades Liferay 6
Novas Funcionalidades Liferay 6Novas Funcionalidades Liferay 6
Novas Funcionalidades Liferay 6
 
Floggy-M3DD-2009-01-21
Floggy-M3DD-2009-01-21Floggy-M3DD-2009-01-21
Floggy-M3DD-2009-01-21
 
Floggy-JustJava-2008-09-10
Floggy-JustJava-2008-09-10Floggy-JustJava-2008-09-10
Floggy-JustJava-2008-09-10
 
Floggy-GUJavaSC-2008-09-20
Floggy-GUJavaSC-2008-09-20Floggy-GUJavaSC-2008-09-20
Floggy-GUJavaSC-2008-09-20
 
Floggy-IIBoot-2008-09-25
Floggy-IIBoot-2008-09-25Floggy-IIBoot-2008-09-25
Floggy-IIBoot-2008-09-25
 

Último

A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
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
 
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
 
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
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
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
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 

Último (20)

A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
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...
 
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
 
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
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
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
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
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
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
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 push to production a project with 100+ plugins in less than 10 minutes

  • 1. How to push to production a project with 100+ plugins in less than 10 minutes Thiago Moreira Senior Consultant @ Liferay Brazil
  • 2. Agenda • Motivation • About the project • Script workflow • Benefits • Challenges • References • Future
  • 3. Motivation (1/2) Back in 2010 I was working in another consulting project and we were getting ready to push to production a new version of an intranet based on Social Office when I had the following phone talk with Michael Han
  • 4. Motivation (2/2) • Thiago: Hey mike, I have to say that I’m confortable with the project implementation but I’m a little worried about the task of push to production… (waiting a response like: don’t worry everything will be fine) • Mike: Thiago, something will go wrong! The thing is, you have to be ready to fix it. • Thiago: Oh man!
  • 5. About the project (1/5) • 1 ext • 4 layout templates • 121 portlets (21 projects with 1 portlet and 1 project with 100 portlets • 12 hooks • 6 themes • 4 webs • Total 148 plugins.
  • 6. About the project (2/5) • 4 Production server in cluster • 1 QA server • 0 Development server • 1 Jenkins server • 1 Nexus server (shared with Jenkins) • Github as source code server
  • 7. About the project (3/5) Tomcat and Deployment Liferay host, deployment bundles user, application user, JVM settings, etc Liferay Environment Liferay patches profiles plugins Properties files Main script
  • 8. About the project (4/5) • 3 Jenkins jobs were configured to each of the 3 branches on git. • Master -> development (every push to upstream) • QA (homologacao) -> QA (every day at 7:00 am) • Production -> production (push of a button)
  • 9. About the project (5/5) Production Environment QA Development Environment Jenkins Environment
  • 10. Script Workflow Check Build Build Environment Liferay Application Clean Build Configure Deploy to Tomcat Tomcat environment
  • 12. Check environment • It is used to check if the environment is correct 1. It checks if the developer set the target.environment variable 2. It checks if the environment has the correct Ant version (configurable) 3. It checks if the environment has the correct Maven version (configurable)
  • 14. Clean 1. It is used to clean the main build directory e.g. the target directory.
  • 16. Build Tomcat 1. Unpack a vanilla Tomcat from the ${basedir}/src/main/bundle directory to ${basedir}/target 1. Delete all webapps’ directory content 2. Delete all *.bat files from bin directory 3. Set execution permission on *.sh files from bin directory
  • 18. Build Liferay 1. Unpacks the ${basedir}/src/main/bundles/liferay- version.war to ${tomcat}/webapps/ROOT 2. Unpacks the ${basedir}/src/main/bundles/liferay- dependencies-version.zip to ${tomcat}/lib 3. Install and configure the patching-tool-4.zip into the right place (liferay home) 4. Copy the license to the deploy directory
  • 20. Build Application (1/2) 1. Build and direct-deploy the ext project Ant based 2. Call Maven to build the other projects • The sequence of build is defined at the pom.xml and it is • commons • webs • layouttpl • themes • hooks • portlets
  • 21. Build Application (2/2) Avoid Liferay to deploy the plugins on startup (cold deploy) 3. Call direct-deploy on each of the projects built by Maven 4. Copy the patches to the patching-tool home 5. Copy plugins (downloaded from liferay.com) to deploy directory
  • 23. Configure Tomcat (1/2) Worker-Name 1. Creates a MANIFEST.MF file with set a properties that identifies the current build Can be accessed thought www.domain.com/html /environment.txt 2. Configure portal-ext.properties with environment properties 3. Configure server.xml with environment properties
  • 24. Configure Tomcat (2/2) Worker-Name 4. Configure setenv.sh with the proper TOMCAT_HOME and CATALINA_OPTS
  • 26. Deploy to environment (1/2) 1. Pack a tgz bundle with everything built 2. Shutdown the remote Tomcat 3. Remotely remove the old Liferay 4. Copy the bundle to the remote machine 5. Unpack the bundle 6. Change the ownership of liferay home to the application user and group 7. Configure *.sh to be runnable 8. Apply the patches 9. Start the remote Tomcat 10. Wait 90 seconds (configurable) until start the next node
  • 28. Benefits • We use the same script to build and deploy on developers machine as well QA and Production boxes. This ensure that the script is validated several times before run on production. • The whole process does not take more than 10 minutes to finish on any environment. • We are able to rollback the version in production within a few minutes
  • 29. Challenges • Upgrade the version of Liferay from 6.0.11 to 6.0.12 • Push changes that affects the database • If needed put the production environment in maintenance automatically through script. • Test cluster configuration directly on production
  • 30. References • Continuous Delivery: Reliable Software Releases Through Build, Test, And Deployment Automation by Jez Humble and David Farley
  • 31. Future • Short term • Add jsp pre-compilation • Replace the direct-deploy Ant task per a Maven goal • Use a sudo user to remote deploy instead of root • Middle term • Move the infra structure to a PaaS (Cloudbees) • Script the process of update and restart the web server when needed • Long term • Create a Maven plugin to replace the Ant script
  • 32. Thank you! thiago.moreira@liferay.com tmoreira2020 @ facebook | linkedin | plus | slideshare | twitter Don’t forget to rate the presentation on our mobile app!

Notas del editor

  1. Share our experience during a project that Liferay took over with more than 100 pluginsHow we create a process of push to production and was able to do it consistently
  2. This talk fired two lines of thought: 1º get ready for wherever happen and 2º repeat as much as possible the process to push to production on similar environments to reduce the issues
  3. In the beginning we didn‘t have a Jenkins server or a Development and QA server. The whole process of push to production was manually executedSumming up: chaos!
  4. We matched all branches of the project to one Jenkins job
  5. Describes what the script (deploy.xml) does.
  6. Describes what the script (deploy.xml) does.
  7. Describes what the script (deploy.xml) does.
  8. Describes what the script (deploy.xml) does.
  9. Describes what the script (deploy.xml) does.
  10. Describes what the script (deploy.xml) does.
  11. Describes what the script (deploy.xml) does.
  12. - 3 if Tomcat will run using AJP or HTTP connector and the jvm route name.
  13. - Most of the properties are defined in the environment.properties
  14. Describes what the script (deploy.xml) does.
  15. Every steps in blue runs remotely- The properties from environment.properties are used in the step to connect and access the remote host- You can use a deploy user with limited sudo actions
  16. Every steps in blue runs remotely- The properties from environment.properties are used in the step to connect and access the remote host- You can use a deploy user with limited sudo actions
  17. - The process of migration the script was smooth because we had the all references to Liferay version as a variable