概要
Engine Yard Cloudにて、特定のファイルをすべてのインスタンス(サーバー)に一発で配置する方法を紹介します。
準備
engineyard gemの3.0.0以上をインストールします。
$gem install engineyard
$ey -v
engineyard version 3.0.0
ファイルをインスタンスに上げる
ココでは、test.confを/data/ 以下に上げてみます
$ey scp test.conf /data/ -e #{環境名} --all
コマンドの使い方は、ey scp [転送したいファイル] [転送先]
です。
Appサーバのみを指定したい場合は、最後のオプションが変わります。
$ey scp test.conf /data/ -e todo20_stg --app-servers
ほかにもDBやUtilityインスタンスの指定方法は次のようになっています。(ey helpで確認できます)
-A, [--all] # scp to all servers
[--app-servers] # scp to all application servers
[--db-servers] # scp to database servers
[--db-master] # scp to the master database server
[--db-slaves] # scp to the slave database servers
[--utilities=one two three] # scp to all utility servers or only those with the given names