Mudanças entre as edições de "Desenvolvimento e deploy com Capistrano"
(→Dia -2) |
|||
(6 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
Linha 11: | Linha 11: | ||
* https://github.com/capistrano/capistrano | * https://github.com/capistrano/capistrano | ||
* https://github.com/capistrano/drupal-deploy | * https://github.com/capistrano/drupal-deploy | ||
+ | |||
+ | |||
+ | == Rascunhos == | ||
+ | |||
+ | === Dia - 1 === | ||
+ | |||
+ | ==== Configuração do Ruby para o ubuntu 15 ==== | ||
+ | |||
+ | sudo apt-get install ruby | ||
+ | |||
+ | sudo gem install bundle | ||
+ | |||
+ | -- crie o Gemfile na pasta do drupal com o seguinte comando: | ||
+ | |||
+ | vim Gemfile | ||
+ | |||
+ | -- e com o conteúdo abaixo: | ||
+ | |||
+ | source 'https://rubygems.org' | ||
+ | group :development do | ||
+ | gem "capistrano", "~> 3.4" | ||
+ | end | ||
+ | |||
+ | |||
+ | -- rode seguinte comando na pasta do seu drupal: | ||
+ | |||
+ | bundle install | ||
+ | |||
+ | |||
+ | ```saída | ||
+ | Fetching version metadata from https://rubygems.org/.. | ||
+ | Resolving dependencies... | ||
+ | Installing rake 11.1.1 | ||
+ | Installing i18n 0.7.0 | ||
+ | Installing net-ssh 3.1.0 | ||
+ | Using bundler 1.11.2 | ||
+ | Using net-scp 1.2.1 | ||
+ | Installing sshkit 1.9.0 | ||
+ | Installing capistrano 3.4.0 | ||
+ | Bundle complete! 1 Gemfile dependency, 7 gems now installed. | ||
+ | |||
+ | ``` | ||
+ | |||
+ | -- Rode o comando: | ||
+ | |||
+ | bundle exec cap install | ||
+ | |||
+ | -- saída | ||
+ | ``` | ||
+ | mkdir -p config/deploy | ||
+ | create config/deploy.rb | ||
+ | create config/deploy/staging.rb | ||
+ | create config/deploy/production.rb | ||
+ | mkdir -p lib/capistrano/tasks | ||
+ | create Capfile | ||
+ | Capified | ||
+ | ``` | ||
+ | |||
+ | ==== Instalar o Capistrano para drupal ==== | ||
+ | |||
+ | -- entre no seu Gemfile e coloque o seguinte: | ||
+ | |||
+ | gem 'capistrano-drupal-deploy', '~> 0.0.2' | ||
+ | |||
+ | -- vai ficar assim: | ||
+ | |||
+ | source 'https://rubygems.org' | ||
+ | group :development do | ||
+ | gem "capistrano", "~> 3.4" | ||
+ | gem 'capistrano-drupal-deploy', '~> 0.0.2' | ||
+ | end | ||
+ | |||
+ | -- Em seguida rode: | ||
+ | |||
+ | bundle | ||
+ | |||
+ | -- depois | ||
+ | |||
+ | bundle exec cap install | ||
+ | |||
+ | |||
+ | -- COnfigure o seu Capfile para requisitar o pacote: | ||
+ | |||
+ | require 'capistrano/drupal-deploy' | ||
+ | |||
+ | |||
+ | === Dia -2 === | ||
+ | |||
+ | -- dentro do drupal | ||
+ | |||
+ | /config/deploy/production.rb | ||
+ | |||
+ | |||
+ | set :branch, 'dev' | ||
+ | server '192.168.100.4', | ||
+ | user: 'cabelo', | ||
+ | ssh_options: { | ||
+ | keys: %w(/home/cabelo/.ssh/id_rsa), | ||
+ | forward_agent: true, | ||
+ | auth_methods: %w(publickey password), | ||
+ | #password: 'livre' | ||
+ | } | ||
+ | -- Capfile | ||
+ | |||
+ | set :application, 'drupal' | ||
+ | set :repo_url, 'git@github.com:cabelotaina/drupal_tapirape.git' | ||
+ | set :app_path, "/var/www/html/drupal" | ||
+ | set :linked_files, fetch(:linked_files, []).push('/var/www/html/drupal/sites/default/settings.php') | ||
+ | set :linked_dirs, fetch(:linked_dirs, []).push('/var/www/html/drupal/sites/default/files', 'private-files') | ||
+ | |||
+ | |||
+ | #Fontes | ||
+ | |||
+ | http://bundler.io/ | ||
+ | https://github.com/capistrano/capistrano |
Edição atual tal como às 10h23min de 30 de março de 2016
- Instalar
- Ruby 2.2.2 (sugestão do Maurírilo - rvm) - Capstarno - Bundle
Índice
Fontes
Rascunhos
Dia - 1
Configuração do Ruby para o ubuntu 15
sudo apt-get install ruby
sudo gem install bundle
-- crie o Gemfile na pasta do drupal com o seguinte comando:
vim Gemfile
-- e com o conteúdo abaixo:
source 'https://rubygems.org' group :development do gem "capistrano", "~> 3.4" end
-- rode seguinte comando na pasta do seu drupal:
bundle install
```saída
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake 11.1.1
Installing i18n 0.7.0
Installing net-ssh 3.1.0
Using bundler 1.11.2
Using net-scp 1.2.1
Installing sshkit 1.9.0
Installing capistrano 3.4.0
Bundle complete! 1 Gemfile dependency, 7 gems now installed.
```
-- Rode o comando:
bundle exec cap install
-- saída ``` mkdir -p config/deploy create config/deploy.rb create config/deploy/staging.rb create config/deploy/production.rb mkdir -p lib/capistrano/tasks create Capfile Capified ```
Instalar o Capistrano para drupal
-- entre no seu Gemfile e coloque o seguinte:
gem 'capistrano-drupal-deploy', '~> 0.0.2'
-- vai ficar assim:
source 'https://rubygems.org' group :development do gem "capistrano", "~> 3.4" gem 'capistrano-drupal-deploy', '~> 0.0.2' end
-- Em seguida rode:
bundle
-- depois
bundle exec cap install
-- COnfigure o seu Capfile para requisitar o pacote:
require 'capistrano/drupal-deploy'
Dia -2
-- dentro do drupal
/config/deploy/production.rb
set :branch, 'dev' server '192.168.100.4', user: 'cabelo', ssh_options: { keys: %w(/home/cabelo/.ssh/id_rsa), forward_agent: true, auth_methods: %w(publickey password), #password: 'livre' }
-- Capfile
set :application, 'drupal' set :repo_url, 'git@github.com:cabelotaina/drupal_tapirape.git' set :app_path, "/var/www/html/drupal" set :linked_files, fetch(:linked_files, []).push('/var/www/html/drupal/sites/default/settings.php') set :linked_dirs, fetch(:linked_dirs, []).push('/var/www/html/drupal/sites/default/files', 'private-files')
- Fontes