Last active
August 29, 2015 14:02
-
-
Save polidog/67886ec4719503307ec2 to your computer and use it in GitHub Desktop.
Capistrano3でSymfony2をデプロイする ref: http://qiita.com/polidog/items/47ea1ca1f642a47c6091
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load DSL and Setup Up Stages | |
| require 'capistrano/setup' | |
| # Load DSL and Setup Up Stages | |
| require 'capistrano/setup' | |
| # Includes default deployment tasks | |
| require 'capistrano/deploy' | |
| ++ # Include Symfony2 tasks | |
| ++ require 'capistrano/symfony' | |
| # Includes tasks from other gems included in your Gemfile | |
| # | |
| # For documentation on these, see for example: | |
| # | |
| # https://github.com/capistrano/rvm | |
| # https://github.com/capistrano/rbenv | |
| # https://github.com/capistrano/chruby | |
| # https://github.com/capistrano/bundler | |
| # https://github.com/capistrano/rails | |
| # | |
| # require 'capistrano/rvm' | |
| # require 'capistrano/rbenv' | |
| # require 'capistrano/chruby' | |
| # require 'capistrano/bundler' | |
| # require 'capistrano/rails/assets' | |
| # require 'capistrano/rails/migrations' | |
| # Loads custom tasks from `lib/capistrano/tasks' if you have any defined. | |
| Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :deploy do | |
| after 'deploy:updated', 'symfony:assets:install' | |
| after 'deploy:updated', 'symfony:assetic:dump' | |
| ++task :upload do | |
| ++ on roles(:app) do |host| | |
| ++ upload!('config/parameters.yml',"#{shared_path}/app/config/parameters.yml") | |
| ++ end | |
| ++ end | |
| ++end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ mkdir -p ~/capistrano/test | |
| $ cd ~/capistrano/test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ vim Gemfile | |
| source 'https://rubygems.org' | |
| gem 'capistrano', '~> 3.1' | |
| gem 'capistrano-symfony', '~> 0.1', :github => 'capistrano/symfony' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ bundle ex cap procution deploy:check | |
| ERRORlinked file /var/www/vhost/test/shared/app/config/parameters.yml does not exist on blog.polidog.jp | |
| cap aborted! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ bundle ex cap production deploy:upload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ bundle ex cap procution deploy:check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ bundle ex cap procution deploy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ bundle install --path=vendor/bundler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ bundle ex cap install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ tree | |
| . | |
| ├── Capfile | |
| ├── Gemfile | |
| ├── Gemfile.lock | |
| ├── config | |
| │ ├── deploy | |
| │ │ ├── production.rb | |
| │ │ └── staging.rb | |
| │ └── deploy.rb | |
| └── lib | |
| └── capistrano | |
| └── tasks | |
| 5 directories, 6 files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value | |
| ++ server 'blog.polidog.jp', user:'polidog', role: [:app] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment