ci/cd: si con esto no se aceptan las llaves ssh la voy a tener que hardcodear

This commit is contained in:
f 2020-03-02 13:35:21 -03:00
parent 6b0c787e2b
commit 9eee218eff
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 3 additions and 1 deletions

View file

@ -10,6 +10,8 @@ deploy_application:
- bundle install --path=./vendor - bundle install --path=./vendor
- eval $(ssh-agent) - eval $(ssh-agent)
- echo -e "-----BEGIN OPENSSH PRIVATE KEY-----\n$SSH_PRIVATE_KEY\n-----END OPENSSH PRIVATE KEY-----" | ssh-add - - echo -e "-----BEGIN OPENSSH PRIVATE KEY-----\n$SSH_PRIVATE_KEY\n-----END OPENSSH PRIVATE KEY-----" | ssh-add -
- mkdir -p ~/.ssh
- echo -e "Host *\nVerifyHostKeyDNS yes" > ~/.ssh/config
- echo "$RAILS_MASTER_KEY" > config/master.key - echo "$RAILS_MASTER_KEY" > config/master.key
- bundle exec cap production deploy - bundle exec cap production deploy
- rm -f config/master.key - rm -f config/master.key

View file

@ -11,7 +11,7 @@ set :bundle_flags, '--deployment'
set :bundle_jobs, 1 set :bundle_jobs, 1
set :bundle_env_variables, nokogiri_use_system_libraries: 1 set :bundle_env_variables, nokogiri_use_system_libraries: 1
set :keep_releases, 2 set :keep_releases, 2
set :ssh_options, verify_host_key_dns: true, check_host_ip: true set :ssh_options, check_host_ip: true
set :default_env, set :default_env,
rails_env: 'production', rails_env: 'production',