Craft CMS: Beyond the Small Business; Advanced tools and configurationsCraft CMS: Beyond the Small Business; Advanced tools and configurations

E2c56065efaa68d9db4ffdf4efb6ee74?s=47 Nate Iler
September 27, 2018

Craft CMS: Beyond the Small Business; Advanced tools and configurationsCraft CMS: Beyond the Small Business; Advanced tools and configurations

A high level look at DevOps with Craft CMS. We cover infrastructure architectures, local development with Docker containers, and continuous integration / delivery.

E2c56065efaa68d9db4ffdf4efb6ee74?s=128

Nate Iler

September 27, 2018
Tweet

Transcript

  1. Beyond the Small Business; Advanced tools and configurations Nate Iler

    Flipbox Digital
  2. Security Performance Cost Reliability Infrastructure

  3. • We owe it to our clients • Protect data

    in transit and at rest ◦ SSL ◦ Encryption • Managing access/policies • Omit sensitive data in plain text Security
  4. • Automate scaling ◦ Up for high demand ◦ Down

    for low demand • Automate recovery • Loosely coupling resources • Monitoring Reliability
  5. • Experiment • Decouple with growth ◦ Database ◦ App

    • Appropriate Type / Size • Tune Performance
  6. • Evaluate providers • Leverage efficient services • Automation ◦

    Last project as starting point ◦ Autoscale • Build -vs- Buy Cost
  7. Infrastructures of Today • Expensive • Physical Hardware • Maintenance

    Staff • Single point of failure Datacenter On Premise Cloud / Iaas Infrastructure as Code
  8. Traditional Development Flow local dev development staging UAT / ...

    production
  9. Infrastructure as Code Flow local dev development / staging /

    production
  10. Evolution of Local Development Cowboy Native / MAMP Virtualization Containers

  11. • Consistency • Disposable • Configurable • Lightweight docker-compose.yml Developing

    (locally) with Docker
  12. Evolution of your Infrastructure

  13. only for you

  14. under 1,000 users

  15. 1,000s to less than 10,000 users

  16. 10,000s to 500,000k users

  17. > 500,000 users

  18. Auto-scaling

  19. Impact on Craft Sessions Logging Assets Queue Cache

  20. Centralized Logging Email / SMS Analysis Log Services

  21. Assets Amazon S3, Google Cloud Storage, Rackspace Cloud Files, DigitalOcean

    Spaces, fortrabbit Object Storage Storage Volume Providers <?php $bucketBaseName = 'assets.bucket'; $baseS3Url = 'https://s3.amazonaws.com/'; $baseCDNUrl = 'https://cdn.your-site.com/'; $cloudFrontId = 'XXXXXXX'; return [ '*' => [ 'gallery' => [ 'bucket' => 'test.' . $bucketBaseName , 'hasUrls' => true, 'url' => $baseS3Url . 'test.' . $bucketBaseName . '/', 'subfolder' => 'gallery', 'region' => 'us-east-1', 'expires' => '1 months' ] ], 'production' => [ 'gallery' => [ 'bucket' => $bucketBaseName , 'url' => $baseCDNUrl . '/', 'cfDistributionId' => $cloudFrontId ] ] ]; config/volumes.php
  22. Session Management config/app.php <?php return [ 'components' => [ 'redis'

    => [ 'class' => yii\redis\Connection::class, 'hostname' => getenv('REDIS_HOSTNAME') ], 'session' => [ 'class' => flipbox\craft\session\Redis::class, 'keyPrefix' => 'session_' ] ] ]; composer require flipboxfactory/craft-session-redis 2) 1)
  23. Cache config/app.php <?php return [ 'components' => [ 'redis' =>

    [ 'class' => yii\redis\Connection::class, 'hostname' => getenv('REDIS_HOSTNAME') ], 'cache' => [ 'class' => yii\redis\Cache::class ] ] ]; ApcCache, ArrayCache, DbCache, DummyCache, FileCache, MemCache, WinCache, XCache, ZendDataCache Native Cache Providers
  24. Queues File, Db, Redis, RabbitMQ, AMQP Interop, Beanstalk, Gearman, AWS

    SQS config/app.php Native Queue Providers <?php return [ 'components' => [ 'queue' => [ 'class' => yii\queue\sqs\Queue::class, 'url' => getenv('SQS_URL'), 'region' => getenv('SQS_REGION') ] ] ];
  25. None
  26. None
  27. Pipeline: Project PASS FAIL artifact Only perform deployment from master/develop

    branches git push via webhook Continuous Integration Continuous Delivery deployment provider
  28. Pipeline: Plugin PASS FAIL /docs Only deploy docs from master

    branch git push via webhook Continuous Integration Continuous Delivery
  29. None
  30. 4) 3) 2) 1) Install Docker: https://docs.docker.com/install/ composer create-project flipboxlabs/craft

    <SOME_DIR> make craft-setup make test Example Project Testing starts container, begins craft setup run all tests (via codeception) create new project (forked craftcms/craft)
  31. Thank You! We know; this topic is vast. Join us

    as we take a closer look at the topics covered in this presentation. (click to view this series) DevOps with Craft CMS
  32. Resources • 1Password • LastPass • Let’s Encrypt • AWS

    Certificate Manager • OpenVPN • AWS Auto Scaling • AWS Auto Recovery • Service-oriented architecture
  33. Resources • Terraform (IaC) • CloudFormation (IaC) • Docker •

    Docker for Craft (our starter project) • Scaling Up to Your First 10 Million Users • Shootout at the Local Dev Corral • Containers on AWS • AWS Well-Architected Framework
  34. Resources • Codeception Testing • AWS Instance Types • Splunk

    • Papertrail • Elastic (Beats, Logstash / Kibana / Elasticsearch) • Travis CI • Scrutinizer CI • Jenkins