Skip to content

Commit

Permalink
Merge pull request #329 from flowerett/fix_setup
Browse files Browse the repository at this point in the history
fix missing shell repo variable in setup
  • Loading branch information
gabskoro committed Sep 6, 2015
2 parents 32b2b62 + 504d5cf commit 1a13242
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions data/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@
queue! %[touch "#{deploy_to}/#{shared_path}/config/secrets.yml"]
queue %[echo "-----> Be sure to edit '#{deploy_to}/#{shared_path}/config/database.yml' and 'secrets.yml'."]

queue %[
repo_host=`echo $repo | sed -e 's/.*@//g' -e 's/:.*//g'` &&
repo_port=`echo $repo | grep -o ':[0-9]*' | sed -e 's/://g'` &&
if [ -z "${repo_port}" ]; then repo_port=22; fi &&
ssh-keyscan -p $repo_port -H $repo_host >> ~/.ssh/known_hosts
]
if repository
repo_host = repository.split(%r{@|://}).last.split(%r{:|\/}).first
repo_port = /:([0-9]+)/.match(repository) && /:([0-9]+)/.match(repository)[1] || '22'

queue %[
if ! ssh-keygen -H -F #{repo_host} &>/dev/null; then
ssh-keyscan -t rsa -p #{repo_port} -H #{repo_host} >> ~/.ssh/known_hosts
fi
]
end
end

desc "Deploys the current version to the server."
Expand Down

0 comments on commit 1a13242

Please sign in to comment.