Save 37% off PRO during our Black Friday Sale! »

Continuous Delivery Without The Drama

Continuous Delivery Without The Drama

1097492785caf9ffeebffeb624202d8f?s=128

Otemuyiwa Prosper

April 30, 2016
Tweet

Transcript

  1. CONTINUOUS DELIVERY WITHOUT THE DRAMA ( Deploying via Heroku Pipeline)

    forLoop 2016 @unicodeveloper By PROSPER OTEMUYIWA
  2. Who am I ? forLoop 2016 @unicodeveloper

  3. • Technical Trainer @ Andela • Founder & Teacher @

    goodheads.io • Organizer of Lagos PHP Meetups • Organizer of Lagos Laravel Meetups • Open Sorcerer • GitHub & Twitter: @unicodeveloper forLoop 2016 @unicodeveloper
  4. Where are we coming from? • Live Editing on Server

    with Notepad, Dreamweaver, even Netbeans. • Development? Staging? Production? - What the hell are those? • Downloading & Pushing back Files with FileZilla • CPANEL - Our Lord & Personal Savior forLoop 2016 @unicodeveloper
  5. Where are we now? - Server Platforms Everything is now

    in the cloud, Well…. ...almost everything forLoop 2016 @unicodeveloper
  6. forLoop 2016 @unicodeveloper What is Continuous Delivery? It is a

    software development discipline where you build software in such a way that the software can be released to production at any time. It is an extension of Continuous Integration. Attention - What’s the difference between Continuous Integration & Continuous Delivery? NextSlide++
  7. What is Continuous Integration? Continuous Integration is a software development

    practice where members of a team integrate their work frequently, usually each person integrates at least daily leading to multiple integrations per day. Each integration is verified by an automated build(including test) to detect integration errors as quickly as possible. - Martin Fowler forLoop 2016 @unicodeveloper
  8. Continuous Delivery Vs Continuous Integration? Continuous Integration basically just means

    that the developer’s working copies are synchronized with a shared mainline several times a day. Continuous Delivery is described as the logical evolution of continuous integration: Always be able to put a product into production! There are always arguments regarding these concepts: http://stackoverflow.com/questions/28608015/continuous-integration-vs- continuous-delivery-vs-continuous-deployment forLoop 2016 @unicodeveloper
  9. How do you achieve this without Crying? forLoop 2016 @unicodeveloper

  10. How do you achieve this without feeling there are so

    many processes involved to master? forLoop 2016 @unicodeveloper
  11. Heroku Pipeline to the Rescue!!! forLoop 2016 @unicodeveloper

  12. Typical Software/App Development WorkFlow • Source Code lives on Github/Bitbucket/<insertname>

    • Code is Tested with Travis-CI/Circle-CI/<insertname>- CI • Automatically deploy to staging when CI passes • Manually promote to production after QA or well anytime you are ready. forLoop 2016 @unicodeveloper
  13. Using Pull Requests to Drive Continuous Delivery forLoop 2016 @unicodeveloper

  14. Enough of the Boring Talk, Action Time!!! • Create an

    Account with Heroku • Go to your Dashboard and create an app like so: forLoop 2016 @unicodeveloper
  15. • Create the repository for the app on github like

    so: • Push your app to your repository, by default the master branch • Ensure it has the appropriate Procfile content. I’m using Laravel. • Set your environment variables on Heroku. • Connect to Github and select your repository. forLoop 2016 @unicodeveloper
  16. • Heroku App Creation Flow NextSlide++ forLoop 2016 @unicodeveloper

  17. • Heroku App Creation Flow forLoop 2016 @unicodeveloper NextSlide++

  18. • Heroku App Creation Flow forLoop 2016 @unicodeveloper

  19. • Heroku App Creation Flow NextSlide++ forLoop 2016 @unicodeveloper

  20. Deploy it manually for the first time forLoop 2016 @unicodeveloper

  21. Create a new Pipeline called forloop forLoop 2016 @unicodeveloper

  22. • Now, let’s create the staging app….. forLoop 2016 @unicodeveloper

    NextSlide++
  23. forLoop 2016 @unicodeveloper NextSlide++ ….then create a staging branch

  24. NextSlide++ forLoop 2016 @unicodeveloper ...Change content to Laravel 7

  25. ...Push back & create staging branch on github NextSlide++ forLoop

    2016 @unicodeveloper
  26. NextSlide++ forLoop 2016 @unicodeveloper ...this is the result on the

    staging app url
  27. • Add the Staging app to the existing forloop pipeline

    we created • It automatically adds it to the Staging section of the Pipeline as seen in the diagram below forLoop 2016 @unicodeveloper NextSlide++
  28. • With the Click of a button, you can deploy

    to production anytime. How cool is that? Deploying from forloop-staging.herokuapp.com Deploying to forloop.herokuapp.com forLoop 2016 @unicodeveloper
  29. Continuous Delivery is the extension of Continuous Integration • Developers

    can work on new features/bugs via various branches • Each PR submitted from a branch creates a new review app on heroku. forLoop 2016 @unicodeveloper NextSlide++
  30. NextSlide++ forLoop 2016 @unicodeveloper

  31. • Review app generated. • PR on the left. •

    Build for that PR on the right. WAIT FOR IT!! NextSlide++ forLoop 2016 @unicodeveloper
  32. • A new review app with a unique URL is

    generated for every PR . • Other Engineers on the team can just check the url to check if the feature works as expected without having to pull from the branch every time. THIS SAVES A LOT OF TIME, OMG!!!! VIOLA!!! forLoop 2016 @unicodeveloper
  33. PR Merged from feature branch into Staging Build For Staging

    just after Merge forLoop 2016 @unicodeveloper
  34. forloop Pipeline showing recent deploy from a branch to Staging

    via a PR A click on the Promote to Production button brings up this dialog A click on the Promote button deploys a staging release to Production forLoop 2016 @unicodeveloper
  35. At the end of the day, • 1 Codebase/Repository •

    3 apps ◦ Development - forloop.dev (local machine) - feature branch ◦ Staging - forloop-staging.herokuapp.com (staging server) - staging branch ◦ Production - forloop.herokuapp.com (production server) • Works well for teams of developers & also for Sole Devs CONTINUOUS DELIVERY LIKE A BOSS!!! forLoop 2016 @unicodeveloper
  36. • HOW DID DEVELOPERS LIVE BEFORE NOW? • HOW DID

    PRODUCT MANAGERS SURVIVE BEFORE NOW? • HOW DID USERS MANAGE BROKEN APPS AS A RESULT OF DEVELOPERS CODING ON LIVE PLATFORM BEFORE NOW? QUESTIONS I’M LOOKING FOR ANSWERS TO PS: I’m not affiliated with Heroku in any way & Heroku didn’t sponsor this talk. forLoop 2016 @unicodeveloper
  37. RESOURCES THAT CAN HELP https://devcenter.heroku.com/articles/pipelines https://blog.heroku.com/archives/2013/7/10/heroku-pipelines-beta https://blog.heroku.com/tags/Heroku%20Flow https://blog.heroku.com/archives/2016/2/11/heroku-pipelines-GA forLoop 2016

    @unicodeveloper
  38. THANK YOU! @unicodeveloper forLoop 2016 @unicodeveloper