Skip to content

Commit

Permalink
Add-author-link
Browse files Browse the repository at this point in the history
  • Loading branch information
Leyla Kapi committed Mar 21, 2014
1 parent a8fcb45 commit 83b2cbd
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 2 deletions.
77 changes: 77 additions & 0 deletions source/posts/2013-09-10-capistrano-ile-multistage-deploy.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: Capistrano ile Multistage Deploy
date: 2013-09-10 23:48 UTC
tags: capistrano, deploy, ruby on rails
---

Ürünlerimizi geliştirme aşamasında production ve staging olarak iki sunucuya deploy ediyoruz. Hafta bitiminde yaptığımız işleri staging sunucusuna deploy edip test edilmesini bekliyoruz. Onay geldiğinde ise production sunucusuna gönderiyoruz.

Deploy işlermlerinde bildiğiniz gibi capistrano kullanıyoruz. İşlemleri halihazırda capistrano kullandığınızı düşünerek anlatacağım.

`config/deploy.rb` ye capistrano multistage extension ekliyoruz.

# config/deploy.rb
require 'capistrano/ext/multistage'


ve hangi stage ler olacağını belirtiyoruz

# config/deploy.rb
set :stages, %w(staging production)


config altına deploy adında bir klasör oluşturup içerisine `production.rb` ve `staging.rb` dosyalarını oluşturuyoruz.

# config/deploy/staging.rb
server "156.0.0.0", :web, :app, :db, primary: true
set :port, 1234
set :rails_env, 'staging'

namespace :deploy do
task :setup_config, roles: :app do
# Staging
sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}"

sudo "ln -nfs #{current_path}/config/unicorn_init_#{rails_env}.sh /etc/init.d/unicorn_#{application}"
end
end

# config/deploy/production.rb
server "156.0.0.0", :web, :app, :db, primary: true
set :port, 1234
set :rails_env, 'production'

namespace :deploy do
task :setup_config, roles: :app do
# Production
sudo "ln -nfs #{current_path}/config/nginx-ssl.conf /etc/nginx/sites-enabled/#{application}"

sudo "ln -nfs #{current_path}/config/unicorn_init_#{rails_env}.sh /etc/init.d/unicorn_#{application}"
end
end


Kodlardan da anlaşılacağı gibi birbirinden farklı olacak şeyleri ayrı dosyalara taşıdık. Ortak olanlar ise `deploy.rb` de kalıyor.

Deploy kodunuda şu şekilde çalıştırıyoruz.

cap production deploy
cap staging deploy


veya

# config/deploy.rb
set :default_stage, "staging"


default stage belirtip

cap deploy


yapıyoruz.

Kolaylıklar dilerim.

[Muhammet DİLEK](http://twitter.com/muhammetdilek)
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,6 @@ Eğer daha önce upload ettiğiniz resimlere de watermark'ınızın eklenmesini

rake'ini çalıştırmanız yeterlidir.

[1]: https://github.com/thoughtbot/paperclip
[1]: https://github.com/thoughtbot/paperclip

[Hamit Türkü KAYA](http://twitter.com/hamitturkukaya)
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@ Teklifinizin 2. aşamaya geçmesi halinde proje detaylarını sizinle paylaşaca
[11]: http://www.imdb.com/media/rm285643776/tt0479952
[12]: http://www.imdb.com/media/rm235312128/tt0479952
[13]: http://www.lab2023.com/wp-content/uploads/2013/10/3d_modelleme_ve_animasyon_isleri_outsource.pdf

[Tayfun Öziş ERİKAN](http://twitter.com/toziserikan)
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ Merhaba,
İlgilenen arkadaşlar bize **0 258 215 5010** nolu telefondan veya **Tayfun Öziş ERİKAN - tayfun.ozis.erikan[at]lab2023.com** adresinden konu hakkında iletişime geçebilirler.

[1]: http://www.lab2023.com/3d-karakter-modelleme-ve-animasyon-outsource-is-ilani

[Tayfun Öziş ERİKAN](http://twitter.com/toziserikan)
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ When you create a MediumEditor object with '.editable' class, all elements (exce

Real magic we'll use is "bind" method of HTML elements. (Also I must warn you that you must include standard jQuery libraries). When a editable class element is changed, inner code of bind method will run. This way we'll get the editable element's ***data-field-id*** and concatenate it with "#post_" string.

Then we set the value of "#post_element" with editable class element's inner HTML. If you keep the names of hidden element and editable section same, you get a polymorphic synchronization. So you can use multiple Medium Editor input fields.
Then we set the value of "#post_element" with editable class element's inner HTML. If you keep the names of hidden element and editable section same, you get a polymorphic synchronization. So you can use multiple Medium Editor input fields.


[Ahmet Sezgin DURAN](http://twitter.com/@marjinal1st)
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,5 @@ Css çıktısı:
float: right;
width: 31.25%;
}

[Safiye Sepetçi](http://twitter.com/safiyesepetci)

0 comments on commit 83b2cbd

Please sign in to comment.