0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Redmine データベース接続設定ファイルの作成

Posted at

前提条件

  1. 準備
    =======

0.1. DB設定情報ディレクトリの指定

変数の指定
DIR_CONF_DB='config-db-handson-20170213'
コマンド
mkdir -p ${DIR_CONF_DB}

0.2. AMI設定情報ディレクトリの指定

変数の指定
DIR_CONF_AMI='config-ami-handson-20170213'
コマンド
mkdir -p ${DIR_CONF_AMI}
  1. 事前作業
    ===========

1.1. db接続情報の指定

今回は、下記の情報を使います。(ハンズオン終了後、インスタンス削除予定です。)

変数の設定
RDS_INSTANCE_ENDPOINT='postgre-dev-20170213.cmn5szrcljpv.ap-northeast-1.rds.amazonaws.com'
変数の設定
RDS_DB_NAME='redmine_db'
変数の設定
RDS_USER_NAME='redmine_admin'
変数の設定
RDS_USER_PASS='#DBPass123'
  1. AMI設定情報の作成
    ====================
変数の設定
FILE_INPUT="${DIR_CONF_AMI}/database.yml"
コマンド
cat << ETX

        FILE_INPUT:            ${FILE_INPUT}
        RDS_INSTANCE_ENDPOINT: ${RDS_INSTANCE_ENDPOINT}
        RDS_DB_NAME:           ${RDS_DB_NAME}
        RDS_USER_NAME:         ${RDS_USER_NAME}
        RDS_USER_PASS:         ${RDS_USER_PASS}

ETX
コマンド
cat << EOF > ${FILE_INPUT}
      production:
        adapter: postgresql
        database: ${RDS_DB_NAME}
        host: ${RDS_INSTANCE_ENDPOINT}
        username: ${RDS_USER_NAME}
        password: "${RDS_USER_PASS}"
        encoding: utf8
EOF

cat ${FILE_INPUT}
  1. 事後作業
    ===========

完了

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?