Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Continuous Delivery Without The Drama

Continuous Delivery Without The Drama

Otemuyiwa Prosper

April 30, 2016
Tweet

More Decks by Otemuyiwa Prosper

Other Decks in Technology

Transcript

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

    forLoop 2016 @unicodeveloper By PROSPER OTEMUYIWA
  2. • 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
  3. 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
  4. Where are we now? - Server Platforms Everything is now

    in the cloud, Well…. ...almost everything forLoop 2016 @unicodeveloper
  5. 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++
  6. 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
  7. 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
  8. How do you achieve this without feeling there are so

    many processes involved to master? forLoop 2016 @unicodeveloper
  9. 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
  10. 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
  11. • 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
  12. • 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++
  13. • 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
  14. 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++
  15. • Review app generated. • PR on the left. •

    Build for that PR on the right. WAIT FOR IT!! NextSlide++ forLoop 2016 @unicodeveloper
  16. • 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
  17. PR Merged from feature branch into Staging Build For Staging

    just after Merge forLoop 2016 @unicodeveloper
  18. 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
  19. 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
  20. • 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