LoginSignup
1
1

More than 5 years have passed since last update.

Engine Yardですべてのサーバに特定のファイルを配置する

Last updated at Posted at 2014-08-27

スクリーンショット 2014-08-27 14.11.47.png

概要

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

適応

dotenvを使って、環境設定をばらまく

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1