SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
Build & deploy
PHP applications*
brief introduction
Who am I ?
Anton Babenko
@antonbabenko
Tech lead at Zoozoo.com
Symfony2/PHP/MySQL
Develop > Build > Test > Deploy
Develop > Build > Test > Deploy
Develop locally, run some tests, commit and
push code…
Develop > Build > Test > Deploy
?
Develop > Build > Test > Deploy
Automate
Develop Build Test Deploy
Automate and get:
● Faster development cycle
● Easier handover to new team members
● Improves quality
● Reduces errors
● Saves time
● Establish routine process which team can rely on
Develop Build Test Deploy
What to automate:
● Dependency & configuration management
○ Using Puppet, Chef, Ansible, bash scripting
● Compilation, minification of your assets
● Running tests
● Creation of documentation and changelogs
● Packaging
● Deployment
Develop Build Test Deploy
How to build?
Develop Build Test Deploy
How to build? Why do you need a build tool?
● To prepare a project to act in a specific environment
Should be no room for misconfiguration
● Staging should have environment similar to
production
Develop Build Test Deploy
Example flow:
● Get project files from VCS
● Configure
● DB Migration
● Run package managers and builders (npm, bower,
grunt)
● Upload
● Cache warmup
● Clear opcache
Develop Build Test Deploy
Popular build & deployment tools for PHP projects:
● Bash scripting (Still hit #1)
● Apache Ant
● Phing
● Capistrano
● Fabric
● http://en.wikipedia.org/wiki/List_of_build_automation_software
or use PaaS
Develop Build Test Deploy
PHP PaaS Providers:
PagodaBox
AppFog
Heroku
fortrabbit
Engine Yard Cloud
Red Hat OpenShift Platform
dotCloud
http://www.phptherightway.com/#servers_and_deployment
AWS Elastic Beanstalk
cloudControl
Windows Azure
Zend Developer Cloud
Google App Engine
Jelastic
Develop Build Test Deploy
● Bash scripting = be creative as you wish
● Jenkins CI + Apache Ant + jenkins-php.org = great
starting point
● Phing = “Apache Ant written in PHP”
● Capistrano
● Fabric
Develop Build Test Deploy
● Bash scripting = be creative as you wish
● Jenkins CI + Apache Ant + jenkins-php.org = great
starting point
● Phing = “Apache Ant written in PHP”
● Capistrano = for builds and deployments
● Fabric
Develop Build Test Deploy
Capistrano is an open source tool for running scripts on
multiple servers. It’s primary use is for easily deploying
applications.
capifony is a deployment recipes collection that works
with both symfony and Symfony2 applications.
Source: capifony.org
Develop Build Test Deploy
# gem install hipchat newrelic_rpm
if exists?(:config_hipchat_token)
require 'hipchat/capistrano'
set :hipchat_token, "#{config_hipchat_token}"
set :hipchat_room_name, "Developers chat"
end
# Recipe:
# github.com/ekino/EkinoNewRelicBundle/blob/master/Resources/recipes/newrelic.rb
if exists?(:config_newrelic_license)
require 'new_relic/recipes'
set :newrelic_license_key, "#{config_newrelic_license}"
set :newrelic_appname, "You name it"
after "deploy", "newrelic:notice_deployment"
end
Capifony sugar (1/4):
Develop Build Test Deploy
after "symfony:composer:install", "symfony:verify_console"
namespace :symfony do
task :verify_console do
capifony_pretty_print "--> Run app/console to verify if parameters.yml has all
required keys and application is runnable"
if capture("#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console}
> /tmp/app_console_output 2>&1 ; echo $?'").to_s.strip != "0"
run "cat /tmp/app_console_output && rm -rf /tmp/app_console_output"
raise CommandError.new("There was an unrecoverable error.")
end
capifony_puts_ok
end
end
Capifony sugar (2/4):
Develop Build Test Deploy
# Update assets_version
# Source: https://github.com/kachkaev/KachkaevAssetsVersionBundle
namespace :assets_version do
task :increment do
capifony_pretty_print "--> Increment assets_version"
run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console}
assets_version:increment --env=#{symfony_env_prod}'"
capifony_puts_ok
end
end
Capifony sugar (3/4):
Develop Build Test Deploy
# Run migration on one DB server instead of all:
role :web, "www1.mysite.com", "www2.mysite.com"
role :app, "www1.mysite.com", "www2.mysite.com"
role :db, "db1.mysite.com", :primary => true
role :db, "db2.mysite.com"
role :db, "db3.mysite.com"
Capifony sugar (4/4):
Develop Build Test Deploy
Capifony questions?
http://stackoverflow.com/questions/tagged/capifony
Want something with GUI?
http://www.deployhq.com/
Develop Build Test Deploy
Questions?
Questions?
Questions?
Questions?
Thanks!

Mais conteúdo relacionado

Mais procurados

Mais procurados (19)

Organizing Your PHP Projects (2010 ConFoo)
Organizing Your PHP Projects (2010 ConFoo)Organizing Your PHP Projects (2010 ConFoo)
Organizing Your PHP Projects (2010 ConFoo)
 
Developing better PHP projects
Developing better PHP projectsDeveloping better PHP projects
Developing better PHP projects
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsTYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
 
A Personal Journey
A Personal JourneyA Personal Journey
A Personal Journey
 
Drupal Performance
Drupal Performance Drupal Performance
Drupal Performance
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
 
ZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small TeamsZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small Teams
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Frontend testing with Codeception
Frontend testing with CodeceptionFrontend testing with Codeception
Frontend testing with Codeception
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
How do I Write Testable Javascript so I can Test my CF API on Server and Client
How do I Write Testable Javascript so I can Test my CF API on Server and ClientHow do I Write Testable Javascript so I can Test my CF API on Server and Client
How do I Write Testable Javascript so I can Test my CF API on Server and Client
 
Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development Workflow
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?
 
The New Frontend Toolchain
The New Frontend ToolchainThe New Frontend Toolchain
The New Frontend Toolchain
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Desktop Apps with PHP and Titanium
Desktop Apps with PHP and TitaniumDesktop Apps with PHP and Titanium
Desktop Apps with PHP and Titanium
 

Destaque

Deploy PHP Apps on AWS Beanstalk & Deploy with Git
Deploy PHP Apps on AWS Beanstalk & Deploy with GitDeploy PHP Apps on AWS Beanstalk & Deploy with Git
Deploy PHP Apps on AWS Beanstalk & Deploy with Git
Amazon Web Services
 

Destaque (13)

Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
 
Introduction à l'intégration continue en PHP
Introduction à l'intégration continue en PHPIntroduction à l'intégration continue en PHP
Introduction à l'intégration continue en PHP
 
PHP Unconference Continuous Integration
PHP Unconference Continuous IntegrationPHP Unconference Continuous Integration
PHP Unconference Continuous Integration
 
Building and Deploying PHP Apps Using phing
Building and Deploying PHP Apps Using phingBuilding and Deploying PHP Apps Using phing
Building and Deploying PHP Apps Using phing
 
Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
 
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...
 
Deploying PHP applications with Phing
Deploying PHP applications with PhingDeploying PHP applications with Phing
Deploying PHP applications with Phing
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
 
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
 
Continuous Integration and PHP
Continuous Integration and PHPContinuous Integration and PHP
Continuous Integration and PHP
 
Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008Enterprise PHP Development - ZendCon 2008
Enterprise PHP Development - ZendCon 2008
 
Deploy PHP Apps on AWS Beanstalk & Deploy with Git
Deploy PHP Apps on AWS Beanstalk & Deploy with GitDeploy PHP Apps on AWS Beanstalk & Deploy with Git
Deploy PHP Apps on AWS Beanstalk & Deploy with Git
 
Principles and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyPrinciples and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at Etsy
 

Semelhante a Build & deploy PHP application (intro level)

Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
D
 
Lighning Talk: PHP build process
Lighning Talk: PHP build processLighning Talk: PHP build process
Lighning Talk: PHP build process
Bryan Agee
 
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
AgileNCR2013
 
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptxCoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
Hervé Boutemy
 

Semelhante a Build & deploy PHP application (intro level) (20)

CI
CICI
CI
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
 
Lighning Talk: PHP build process
Lighning Talk: PHP build processLighning Talk: PHP build process
Lighning Talk: PHP build process
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshop
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.
 
2016 05-cloudsoft-amp-and-brooklyn-new
2016 05-cloudsoft-amp-and-brooklyn-new2016 05-cloudsoft-amp-and-brooklyn-new
2016 05-cloudsoft-amp-and-brooklyn-new
 
Flash Camp Chennai - Build automation of Flex and AIR applications
Flash Camp Chennai - Build automation of Flex and AIR applicationsFlash Camp Chennai - Build automation of Flex and AIR applications
Flash Camp Chennai - Build automation of Flex and AIR applications
 
Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015
 
Unit testing symfony plugins with php unit
Unit testing symfony plugins with php unitUnit testing symfony plugins with php unit
Unit testing symfony plugins with php unit
 
Continuous Testing and New Tools for Automation - Presentation from StarWest ...
Continuous Testing and New Tools for Automation - Presentation from StarWest ...Continuous Testing and New Tools for Automation - Presentation from StarWest ...
Continuous Testing and New Tools for Automation - Presentation from StarWest ...
 
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
Agile NCR 2013- Shekhar Gulati - Open shift platform-for-rapid-and-agile-deve...
 
Evolution of deploy.sh
Evolution of deploy.shEvolution of deploy.sh
Evolution of deploy.sh
 
Flask for cs students
Flask for cs studentsFlask for cs students
Flask for cs students
 
Automation - fabric, django and more
Automation - fabric, django and moreAutomation - fabric, django and more
Automation - fabric, django and more
 
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptxCoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
CoC NA 2023 - Reproducible Builds for the JVM and beyond.pptx
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack Summit
 
Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 

Mais de Anton Babenko

Mais de Anton Babenko (20)

Manage any AWS resources with Terraform 0.12 - April 2020
Manage any AWS resources with Terraform 0.12 - April 2020Manage any AWS resources with Terraform 0.12 - April 2020
Manage any AWS resources with Terraform 0.12 - April 2020
 
Terraform 0.12 + Terragrunt
Terraform 0.12 + TerragruntTerraform 0.12 + Terragrunt
Terraform 0.12 + Terragrunt
 
Terraform Best Practices - DevOps Unicorns 2019
Terraform Best Practices - DevOps Unicorns 2019Terraform Best Practices - DevOps Unicorns 2019
Terraform Best Practices - DevOps Unicorns 2019
 
Terraform AWS modules and some best practices - September 2019
Terraform AWS modules and some best practices - September 2019Terraform AWS modules and some best practices - September 2019
Terraform AWS modules and some best practices - September 2019
 
What you see is what you get for AWS infrastructure
What you see is what you get for AWS infrastructureWhat you see is what you get for AWS infrastructure
What you see is what you get for AWS infrastructure
 
Terraform AWS modules and some best-practices - May 2019
Terraform AWS modules and some best-practices - May 2019Terraform AWS modules and some best-practices - May 2019
Terraform AWS modules and some best-practices - May 2019
 
Terraform modules and some of best-practices - March 2019
Terraform modules and some of best-practices - March 2019Terraform modules and some of best-practices - March 2019
Terraform modules and some of best-practices - March 2019
 
What you see is what you get for AWS infrastructure
What you see is what you get for AWS infrastructureWhat you see is what you get for AWS infrastructure
What you see is what you get for AWS infrastructure
 
Gotchas using Terraform in a secure delivery pipeline
Gotchas using Terraform in a secure delivery pipelineGotchas using Terraform in a secure delivery pipeline
Gotchas using Terraform in a secure delivery pipeline
 
Описание инфраструктуры с Terraform на будущее
Описание инфраструктуры с Terraform на будущееОписание инфраструктуры с Terraform на будущее
Описание инфраструктуры с Terraform на будущее
 
Preview of Terraform 0.12 + modules.tf - Kiev HUG meetup
Preview of Terraform 0.12 + modules.tf - Kiev HUG meetupPreview of Terraform 0.12 + modules.tf - Kiev HUG meetup
Preview of Terraform 0.12 + modules.tf - Kiev HUG meetup
 
Terraform modules and (some of) best practices
Terraform modules and (some of) best practicesTerraform modules and (some of) best practices
Terraform modules and (some of) best practices
 
Terraform modules and (some of) best practices
Terraform modules and (some of) best practicesTerraform modules and (some of) best practices
Terraform modules and (some of) best practices
 
Terraform modules and best-practices - September 2018
Terraform modules and best-practices - September 2018Terraform modules and best-practices - September 2018
Terraform modules and best-practices - September 2018
 
Building infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowBuilding infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps Krakow
 
Terraform Q&A - HashiCorp User Group Oslo
Terraform Q&A - HashiCorp User Group OsloTerraform Q&A - HashiCorp User Group Oslo
Terraform Q&A - HashiCorp User Group Oslo
 
"I’ve heard you know infrastructure"
"I’ve heard you know infrastructure""I’ve heard you know infrastructure"
"I’ve heard you know infrastructure"
 
Terraform in deployment pipeline
Terraform in deployment pipelineTerraform in deployment pipeline
Terraform in deployment pipeline
 
"Continuously delivering infrastructure using Terraform and Packer" training ...
"Continuously delivering infrastructure using Terraform and Packer" training ..."Continuously delivering infrastructure using Terraform and Packer" training ...
"Continuously delivering infrastructure using Terraform and Packer" training ...
 
Continuous delivery in AWS
Continuous delivery in AWSContinuous delivery in AWS
Continuous delivery in AWS
 

Último

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 

Último (20)

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

Build & deploy PHP application (intro level)

  • 1. Build & deploy PHP applications* brief introduction
  • 2. Who am I ? Anton Babenko @antonbabenko Tech lead at Zoozoo.com Symfony2/PHP/MySQL
  • 3. Develop > Build > Test > Deploy
  • 4. Develop > Build > Test > Deploy Develop locally, run some tests, commit and push code…
  • 5. Develop > Build > Test > Deploy ?
  • 6. Develop > Build > Test > Deploy Automate
  • 7. Develop Build Test Deploy Automate and get: ● Faster development cycle ● Easier handover to new team members ● Improves quality ● Reduces errors ● Saves time ● Establish routine process which team can rely on
  • 8. Develop Build Test Deploy What to automate: ● Dependency & configuration management ○ Using Puppet, Chef, Ansible, bash scripting ● Compilation, minification of your assets ● Running tests ● Creation of documentation and changelogs ● Packaging ● Deployment
  • 9. Develop Build Test Deploy How to build?
  • 10. Develop Build Test Deploy How to build? Why do you need a build tool? ● To prepare a project to act in a specific environment Should be no room for misconfiguration ● Staging should have environment similar to production
  • 11. Develop Build Test Deploy Example flow: ● Get project files from VCS ● Configure ● DB Migration ● Run package managers and builders (npm, bower, grunt) ● Upload ● Cache warmup ● Clear opcache
  • 12. Develop Build Test Deploy Popular build & deployment tools for PHP projects: ● Bash scripting (Still hit #1) ● Apache Ant ● Phing ● Capistrano ● Fabric ● http://en.wikipedia.org/wiki/List_of_build_automation_software or use PaaS
  • 13. Develop Build Test Deploy PHP PaaS Providers: PagodaBox AppFog Heroku fortrabbit Engine Yard Cloud Red Hat OpenShift Platform dotCloud http://www.phptherightway.com/#servers_and_deployment AWS Elastic Beanstalk cloudControl Windows Azure Zend Developer Cloud Google App Engine Jelastic
  • 14. Develop Build Test Deploy ● Bash scripting = be creative as you wish ● Jenkins CI + Apache Ant + jenkins-php.org = great starting point ● Phing = “Apache Ant written in PHP” ● Capistrano ● Fabric
  • 15. Develop Build Test Deploy ● Bash scripting = be creative as you wish ● Jenkins CI + Apache Ant + jenkins-php.org = great starting point ● Phing = “Apache Ant written in PHP” ● Capistrano = for builds and deployments ● Fabric
  • 16. Develop Build Test Deploy Capistrano is an open source tool for running scripts on multiple servers. It’s primary use is for easily deploying applications. capifony is a deployment recipes collection that works with both symfony and Symfony2 applications. Source: capifony.org
  • 17. Develop Build Test Deploy # gem install hipchat newrelic_rpm if exists?(:config_hipchat_token) require 'hipchat/capistrano' set :hipchat_token, "#{config_hipchat_token}" set :hipchat_room_name, "Developers chat" end # Recipe: # github.com/ekino/EkinoNewRelicBundle/blob/master/Resources/recipes/newrelic.rb if exists?(:config_newrelic_license) require 'new_relic/recipes' set :newrelic_license_key, "#{config_newrelic_license}" set :newrelic_appname, "You name it" after "deploy", "newrelic:notice_deployment" end Capifony sugar (1/4):
  • 18. Develop Build Test Deploy after "symfony:composer:install", "symfony:verify_console" namespace :symfony do task :verify_console do capifony_pretty_print "--> Run app/console to verify if parameters.yml has all required keys and application is runnable" if capture("#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} > /tmp/app_console_output 2>&1 ; echo $?'").to_s.strip != "0" run "cat /tmp/app_console_output && rm -rf /tmp/app_console_output" raise CommandError.new("There was an unrecoverable error.") end capifony_puts_ok end end Capifony sugar (2/4):
  • 19. Develop Build Test Deploy # Update assets_version # Source: https://github.com/kachkaev/KachkaevAssetsVersionBundle namespace :assets_version do task :increment do capifony_pretty_print "--> Increment assets_version" run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} assets_version:increment --env=#{symfony_env_prod}'" capifony_puts_ok end end Capifony sugar (3/4):
  • 20. Develop Build Test Deploy # Run migration on one DB server instead of all: role :web, "www1.mysite.com", "www2.mysite.com" role :app, "www1.mysite.com", "www2.mysite.com" role :db, "db1.mysite.com", :primary => true role :db, "db2.mysite.com" role :db, "db3.mysite.com" Capifony sugar (4/4):
  • 21. Develop Build Test Deploy Capifony questions? http://stackoverflow.com/questions/tagged/capifony Want something with GUI? http://www.deployhq.com/
  • 22. Develop Build Test Deploy Questions? Questions? Questions? Questions?