平素よりQA@ITをご利用いただき、誠にありがとうございます。 QA@ITは「質問や回答を『共有』し『編集』していくことでベストなQAを蓄積できる、ITエンジニアのための問題解決コミュニティー」として約7年間運営をしてきました。これまでサービスを続けることができたのは、QA@ITのコンセプトに共感をいただき、適切な質問や回答をお寄せいただいた皆さまのご支援があったからこそと考えております。重ねて御礼申し上げます。 しかしながら、エンジニアの情報入手方法の多様化やQAサービス市場の状況、@ITの今後のメディア運営方針などを検討した結果、2020年2月28日(金)15:00をもちましてQA@ITのサービスを終了することにしました。 これまでご利用をいただきました皆さまには残念なお知らせとなり、誠に心苦しく思っております。何とぞ、ご理解をいただけますと幸いです。 QA@ITの7年間で皆さまの知識
Capistranoではリリース間でファイルを共有するためにいくつかのディレクトリがshared/以下にコピーされ、そちらにシンボリックリンクをはるようになっている。たとえばpublic/assetsとかlogとか。 この仕組は任意のディレクトリに対しても使うことができる。 # config/deploy.rb set :shared_children, shared_children + %w(path/to/hoge) こうするとcap deploy:setupしたときにshared/hogeに空ディレクトリが作成され、cap deployしたときにcurrent/path/to/hogeからそちらへとシンボリックリンクが作成される。なお元々あったcurrent/path/to/hogeは削除される。 追記 Capistrano3ではディレクトリ作成の仕組みが変わっているので要注意。
Like many others I've seen in the Googleverse, I fell victim to the File.exists? trap, which of course checks your local file system, not the server you are deploying to. I found one result that used a shell hack like: if [[ -d #{shared_path}/images ]]; then ... but that doesn't sit well with me, unless it were wrapped nicely in a Ruby method. Has anybody solved this elegantly?
UPDATE: I've updated the post to reflect changes in rbenv 0.4.0. I've recently decided to move away from in favor of . I thought RVM was a bit too finicky to use in production and I wanted something simpler that I could wrap my head around. This post is more or less an attempt to collect what I figured out from reading , George Ornbo's and the . On the server As the deployment user (in my case dep
When deploying my RubyOnRails applications with Capistrano and I get errors like this one servers: ["app.myserver.com"] [app.myserver.com] executing command ** [out :: app.myserver.com] sh: bundle: command not found command finished in 31ms servers: ["app.myserver.com"] [app.myserver.com] executing command ** [out :: app.myserver.com] sh: bundle: command not found command finished in 31m
Capistrano has a handy task that runs rake assets:precompile for you when you are deploying your Rails 3.1 application. This gives you an easy way to get the performance boosts of having only one css file and one javascript file to load per request. The price you pay for that benefit is the amount of time it takes to run that rake task when you are deploying. There is a way to get the benefit whil
# config/deploy.rb: set :default_stage, "staging" こう書くとcap deployでデフォルトstagingに行くようになる。
公開日時: 2011-03-09 06:43 Capistranoを使用してrailsのアプリの配備を行っている場合、app_name/releases以下にdeployした回数分だけディレクトリが増えていきます。過去リリースが多くなりすぎた場合はcap deploy:cleanupを使用します。 cap deploy:creanup と入力すると、過去のリリースを削除することができます。 デフォルトの動作では、新しいものから5個を残して削除されます。 (残す個数は、レシピの中で :keep releases を使って指定できます) 注意: 削除してしまったバージョンに対しては、 deploy:rollback タスクは実行できなくなります。 キーワード: capistrano rails deploy
Railsアプリのデプロイツールとしてデファクトスタンダード的な位置にあるCapistranoについて。 TL;DR HOSTSとROLESではなく、HOSTFILTERとHOSTROLEFILTERを使え。 タスクの実行先制限方法 Capistranoは、デプロイ先サーバに"ロール"を設定し、特定のロールに所属するサーバ全てに対して一括でなにかしらの処理を実行させることができる。 # deploy.rb server 'webserver1' :web server 'webserver2' :web server 'dbserver', :db, :primary => true ... task :do_something, :roles => :web do ... end cap do_something #=> webserver1, webserver2に対してのみdo_so
Capistranoを利用してデプロイを行う場合、デフォルトの設定では、デプロイ先のサーバからモジュールを取得するためにソースが管理されているリポジトリにアクセスする。 ただ、ソースを管理しているリポジトリは社内にあって、デプロイ先のサーバからは直接アクセスできな環境というのが結構多いと思う。 そうったケースの場合は、deploy.rbの設定を以下のように設定する必要がある。 # リポジトリのソースをCapistranoを実行するマシンに取得→圧縮→デプロイ→解凍→配置する。 set :deploy_via, :copy # ↑でリポジトリからソースを取得する際にエクスポートするように設定。(デフォルトはエクスポートではなく、チェックアウト) set :copy_strategy, :export # 圧縮ファイルのタイプを指定。(デフォルトは、tar.gz) set :copy_comp
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く