Skip to content

Commit

Permalink
✨ EC2 に接続できなくなったので PrivateKey を登録するタスクを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
dodonki1223 committed Feb 13, 2022
1 parent 3a5dae7 commit ee0fd97
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,19 @@ commands:
command: cp config/{database_circleci_deploy,database}.yml
bastion-port-forwarding:
steps:
- add_ssh_keys:
fingerprints:
- "09:73:fb:0a:d8:e2:b9:0c:e8:7c:23:7e:65:c0:1c:44"
- run:
name: Register private key for bastion server
command: |
mkdir .ssh
echo ${BASTION_SERVER_PRIVATE_KEY} | base64 --decode >> ~/.ssh/eroge-release.pem
chmod 600 ~/.ssh/eroge-release.pem
- run:
name: Bastion server port forwarding
# 「-o StrictHostKeyChecking=no」は下記の対話処理を省略するために追加
# The authenticity of host 'hoge (fuga)' can't be established.
# RSA key fingerprint is hoge
# Are you sure you want to continue connecting (yes/no)?
command: ssh -o StrictHostKeyChecking=no -f -N -L ${EROGE_RELEASE_DB_LOCAL_PORT}:${EROGE_RELEASE_DB_HOST}:${EROGE_RELEASE_DB_PORT} ${BASTION_SERVER_USER}@${BASTION_SERVER_HOST}
command: ssh -o StrictHostKeyChecking=no -i ~/.ssh/eroge-release.pem -f -N -L ${EROGE_RELEASE_DB_LOCAL_PORT}:${EROGE_RELEASE_DB_HOST}:${EROGE_RELEASE_DB_PORT} -4 ${BASTION_SERVER_USER}@${BASTION_SERVER_HOST}
deploy-notification:
steps:
- slack/status:
Expand Down

0 comments on commit ee0fd97

Please sign in to comment.