Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

DevOps in PHP environment

419 views

Published on

Tools and workflow to use DevOps with PHP

Published in: Software
  • Be the first to comment

DevOps in PHP environment

  1. 1. PHP environment Workflow / Deployment / Tools
  2. 2. Evaldo Felipe 21 6 years SysAdmin 5 months DevOps clint.solutions @evaldofelipe
  3. 3. Gabriel Koerich 26 Adm, full-stack dev & everything between algorit.com.br bulldesk.com.br @gabrielmkoerich
  4. 4. PHP?! ● Easy for beginners ● Easy to "deploy" ● PHP mixed in HTML ● No conventions for function names Evolution < 5.3 Lixo 5.3 Namespaces, closures (anonymous functions) 5.4 Traits, [] for arrays 5.5 OPcache, finally on try blocks 5.6 Agument unpacking (...$args) 7.0 Performance (thanks to HHVM), return types, scalar types (int, float, string, bool), improved exceptions 7.1 Nullable types (?int), catch multiple exceptions
  5. 5. PHP?! Community Composer / Packagist / Autoloader Dotenv PHP FIG and PSRs Standards PSR 1 - Basic Coding PSR 2 - Coding Style Guide PSR 3 - Logger Interface PSR 4 - Autoloading PSR 5 - Caching Interface PSR 7 - HTTP Message Interface
  6. 6. Laravel Framework Released in 2011 Key Features ● Routes ● Controllers ● Service Container & Dependency Injection ● Broadcasting (Pusher or socket.io) ● Migrations (tables) ● Eloquent ORM (sql) ● Artisan command line ● Queues (beanstalkd, redis, amazon sqs) ● Unit Testing ● Laravel Elixir for gulp and Laravel Mix for webpack
  7. 7. Modern PHP
  8. 8. Laravel x Rails
  9. 9. Local Environment
  10. 10. Require mysql and php local $ composer global require laravel/valet $ valet park $ valet paths .dev $ valet domain .etc Valet
  11. 11. /** * Determine if the driver serves the request. * * @param string $sitePath * @param string $siteName * @param string $uri * @return bool */ public function serves($sitePath, $siteName, $uri) { return is_dir($sitePath.'/wp-admin'); }
  12. 12. Production Environment
  13. 13. ACCEPT tcp -- 10.132.103.204 anywhere tcp dpt:mysql ACCEPT udp -- 10.132.103.204 anywhere udp dpt:mysql ACCEPT tcp -- 10.132.103.204 anywhere tcp dpt:postgresql ACCEPT udp -- 10.132.103.204 anywhere udp dpt:postgresql ACCEPT tcp -- 10.132.103.204 anywhere tcp dpt:11211 ACCEPT udp -- 10.132.103.204 anywhere udp dpt:11211 ACCEPT tcp -- 10.132.103.204 anywhere tcp dpt:6379 ACCEPT udp -- 10.132.103.204 anywhere udp dpt:6379 ACCEPT tcp -- 10.132.103.204 anywhere tcp dpt:11300 ACCEPT udp -- 10.132.103.204 anywhere udp dpt:11300
  14. 14. Security and Optimization
  15. 15. Let's Monitor
  16. 16. CloudFlare
  17. 17. Nginx as Load Balancer
  18. 18. Static & socket.io upstreams nginx load balancer - gab static content - gab cloudflare ip config pass to app - gab
  19. 19. DBs
  20. 20. Master / Slave Write / Read Bkp S3 using PHP or CLI Mysql
  21. 21. Background Jobs
  22. 22. Beanstalkd queue + Supervisor
  23. 23. Code Quality
  24. 24. Travis CI Travis CI - gab Code climate - gab
  25. 25. Code Climate
  26. 26. Monitors
  27. 27. Papertrail
  28. 28. Bugsnag
  29. 29. NewRelic
  30. 30. Datadog
  31. 31. That's it! Where is the beer? :D

×