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

Demystifying deployment workflows

Demystifying deployment workflows

David Stoline

February 19, 2021
Tweet

More Decks by David Stoline

Other Decks in Technology

Transcript

  1. All attendees, speakers, sponsors, and volunteers at our conference are

    required to agree with the our code of conduct. We do not tolerate harassment of conference participants in any form. Please abide by our Code of Conduct https://www.fldrupal.camp/community/code-conduct https://www.fldrupal.camp
  2. Code of Conduct Contacts email [email protected] Mike Anello 321-396-2340 https://www.fldrupal.camp

    AmyJune Hineline 831-406-1130 #florida Drupal Slack channel Or email info@fldrupalcamp.org
  3. First-time contributor workshop • Mentored contribution • General contribution #DrupalContributions

    Contribution Day Saturday, February 20, 2021 12:00pm - 3:30pm https://www.fldrupal.camp/conference/contribution-day
  4. Planned Workshops • First-time contributor workshop • Introduction to Merge

    Requests • Mentored Tooling Contribution Day Saturday, February 20, 2021 12:00pm - 3:30pm https://www.fldrupal.camp/conference/contribution-day Planned Initiatives • Olivero Theme • SimplyTest • Drupal Recipes
  5. So, you want to build and launch a Drupal site

    Today I’m going to show you how to work with a project from the very beginning: • Starting on an a previously unconfigured laptop • Showing you some tools along the way • Ending with launching a site into production These days, development starts with Composer — but first, a local development tool!
  6. Wait, what? But the cloud, and AWS, and other things!

    Let’s keep it simple for now: to be honest, most Drupal development starts on someone’s laptop On-Prem Client data center
  7. The local development players • DDEV • Lando • DrupalVM

    • MAMP • XAMP • Roll your own LAMP • Docker • Docksal • Dozens of others https://www.jeffgeerling.com/blog/2020/2020-drupal-local-development-survey-results
  8. Getting started with DDEV Mac/Linux: `brew tap drud/ddev && brew

    install ddev` Windows WSL2: https://ddev.readthedocs.io/en/stable/#installation-or-upgrade-windows-wsl2
  9. Okay, so you want to build a Drupal site `ddev

    composer create drupal/recommended-project`
  10. Let’s talk version control “Version control is the practice of

    tracking and managing changes to software code. Version control systems are software tools that help software teams manage changes to source code over time. As development environments have accelerated, version control systems help software teams work faster and smarter” TL;DR: Use Git https://www.atlassian.com/git/tutorials/what-is-version-control
  11. Let’s talk version control So what about GitHub, GitLab, BitBucket,

    etc These are primarily engineering collaboration tools, with some project management and DevOps features sprinkled in.
  12. Review You’ve now seen taking a site into production beginning

    from inception using a local development tool, as well as git setup and use of GitHub. Quick pause for questions… feel free to use either the Q&A in Zoom or the chat. Now we are going to fast forward to the day when the site is ready to leave your computer!
  13. Local dev problems How do I show my work? •

    Internally ◦ Engineering team members ◦ Project managers ◦ Sprint demos • Externally ◦ Client stakeholders ◦ User acceptance testing ◦ Functional testing How do I reduce risk? • I need a sick day • Coffee doesn’t belong in a laptop • Ugh, some software I use updated and now I’m stuck googling the problem until it’s resolved and I’ve lost a whole day thanks to this
  14. Dev site, but online You need a place to host

    your site, this could be any of the major Drupal hosts or you could host the site yourself in your own datacenter or cloud. Because your code is in GitHub, it makes it really easy to deploy from there
  15. Site creation `ddev-live create site drupal dc-florida \ --git-repo=https://github.com/unn/drup alcamp-flordia

    \ --docroot=web \ --git-rev=main \ --drupal-version=9 \ --run-composer-install`
  16. Deployment workflows Yolo • Branch checked out in an environment

    ◦ Auto-deployments when merged ◦ Miss out on database updates or config imports but worthwhile for non-production environments Responsible • Git tag checked out in prod ◦ Intentional tag change to trigger deployment
  17. Deployments made easy Deployments used to be fragile events that

    required an all hands on deck approach. These days, deployments can be quick, simple, and otherwise non-events. Get back time, focus on your engineering tasks, rather than babysitting your deployments.
  18. Recap You have seen an example of how to create

    a site, store the code on GitHub, host it on DDEV-Live. You have learned how to create a pull request, as well as merge that pull request to trigger a deployment. Advanced: https://www.ddev.com/ddev-live/ci-cd/
  19. Thanks! Additional resources from DDEV • https://www.ddev.com/ddev-live/a-git-based-workflow-from-dev-to-deploy/ • https://www.ddev.com/ddev-local/why-developing-locally-matters/ •

    https://www.ddev.com/ddev-live/moving-cms-sites-around-local-servers/ Find us in gather.town Drupal Slack #ddev and #ddev-live You can find me @davidstoline on Twitter or dstol on d.o