タグ

ブックマーク / ode.hatenadiary.jp (2)

  • capistranoでssh越しのサーバーに設置する場合 - odeの開発メモ日記

    sshでgatewayに接続した後、そこを踏み台として他のpc(Webサーバー,DBサーバー等)に繋いで作業する場合があると思います。 (設置先が自社サーバーではなく、外部のサーバーを使う場合やレンタルサーバー等で仮想環境を使用している場合等でしょうか) capistranoのデフォルトでは直接接続できるサーバーを対象にしてますが、設定することで上記のようなssh越しの設置も可能です。 やり方 下記の2つのオプションを指定ですればOKです。 deploy.rb # sshのgateway(踏み台)のIPを指定 set :gateway, "203.182.58.106" # ファイルの転送にsvnでなく、ファイルコピーを使用する。大抵はssh越しのサーバーから開発のsvnは参照できないため。 set :deploy_via, :copy 注意点 gatewayになるサーバーと奥にある設置対

    capistranoでssh越しのサーバーに設置する場合 - odeの開発メモ日記
  • railsバッチの作り方 - odeの開発メモ日記

    作り方 例えば検索インデックス登録用バッチとしてcreate_search_indexというバッチを作る場合 ファイル構成 app/ batch/ ← このフォルダを追加 create_search_index/ create_search_index_batch.rb - railsバッチを定義する create_search_index.sh.sample - 実行用シェルスクリプトのサンプル create_search_index.sh - 実行用シェルスクリプト。sampleをコピーして使う。svn除外にする。 ・・・ create_search_index.sh.sample #!/bin/sh #staging ruby `dirname $0`/../../script/runner `dirname $0`/create_search_index_batch.rb --fe

    railsバッチの作り方 - odeの開発メモ日記
    animist
    animist 2011/08/20
    rails runner に自作スクリプトを喰わせる事でバッチ処理を作れるぞ!
  • 1