SlideShare a Scribd company logo
1 of 12
DEPLOY
SYMFONY WITH CAPISTRANO
СПОСОБЫ DEPLOY


FTP

SVN checkout/update через SSH

Скрипты на основе rsync и SSH

Специализированные решения
CAPISTRANO


Обновление кода

Откат версий

Применение миграций

Автоматизация операций
КОМАНДА CAP


Работает из командной строки

Опции: cap -h (cap --help)

Задачи с описанием: cap -T (cap --tasks)
СХЕМА СЕРВЕРОВ


 SVN          WEB


                    APP



LOCAL          DB
СТРУКТУРА ДИРЕКТОРИЙ
[deploy_to]
[deploy_to]/releases
[deploy_to]/releases/20080819001122
[deploy_to]/releases/...
[deploy_to]/shared
[deploy_to]/current -> [deploy_to]/releases/20080819001122




Директория на сервере
set :deploy_to, "/var/www"
РОЛИ СЕРВЕРОВ

Когда много серверов
role :app, "example.com"
role :web, "example.com"
role :db, "example.com", :primary => true



Если сервер всего один
server "example.com", :app, :web, :db, :primary => true
CAPIFY SYMFONY
Создание конфигурационных файлов
capify .


Главный файл Capistrano
Capfile


Конфигурация deploy
config/deploy.rb




http://code.google.com/p/sfcap-example/
SUBVERSION
set :application, 'sfcap-example'


set :scm, :subversion
set :repository,  'https://sfcap-example.googlecode.com/
svn/trunk/'



set :scm_prefer_prompt, true
set :scm_auth_cache, false
CUSTOMIZE
after 'deploy:update', 'deploy:customize'


namespace :deploy do
  task :customize do
    php = fetch(:php, 'php')

    run "find #{current_path}/web -depth -wholename '*/.svn*' -delete"

        run <<-CMD
          ln -nfs #{shared_path}/databases.yml #{current_path}/config/databases.yml &&
          ln -nfs #{shared_path}/symfony.php #{current_path}/config/symfony.php
        CMD

    run <<-CMD
      cd #{current_path} &&
      #{php} symfony plugin:publish-assets &&
      #{php} symfony project:permissions
    CMD
  end
end
DEPLOY!


cap deploy:setup

cap deploy

cap deploy:migrate
ДРУГИЕ ЗАДАЧИ


cap deploy:pending

cap deploy:rollback

cap deploy:cleanup

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Deploy Symfony With Capistrano