Share
Embed
Demystifying deployment workflows
Talk presented originally at Florida DrupalCamp 2021
https://www.fldrupal.camp/sessions/development-performance/demystifying-deployment-workflows
Fully videos available via https://docs.google.com/presentation/d/1k7nMH5GvRpdtXdMmxAdJhwPmT6D27Q3TQtX8oIh-zyA/edit?usp=sharing
David Stoline
February 19, 2021
Transcript
23 slides
-
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 -
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 -
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 -
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 -
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! -
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 -
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 -
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 -
Okay, so you want to build a Drupal site `ddev
composer create drupal/recommended-project` -
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 -
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. -
Now what? Well, the engineering part. https://www.fldrupal.camp/sessions/beginner-track/anatomy-git-workflow-and-essentials- commands-you-must-memorize https://www.drupal.org/docs/develop/local-server-setup/linux-development-environments/ set-up-a-local-development-drupal-0-7
https://www.lullabot.com/articles/development-workflow-drupal-8-projects -
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! -
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 -
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 -
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` -
Site creation, push assets `ddev export-db > db.sql.gz ddev-live push
database dc-florida ./db.sql.gz` -
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 -
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. -
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/ -
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