Skip to content

Instantly share code, notes, and snippets.

@metaodi
Forked from MarkNijhof/.travis.yml
Created October 11, 2012 22:12
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save metaodi/cd5557fea4bf175b6813 to your computer and use it in GitHub Desktop.
Save metaodi/cd5557fea4bf175b6813 to your computer and use it in GitHub Desktop.
pushing to heroku with travis
language: ruby
rvm:
- 1.9.3
#after_install:
# I had to move all the steps into the after_script to get them called
after_script:
- gem install heroku
- export HEROKU_API_KEY=<your key here> # you probably want to encrypt this key using the travis gem and "travis encryp" cmd
- yes | ruby travis_deployer.rb
- heroku keys:clear
- yes | heroku keys:add
- git push heroku master # or whatever your heroku push looks like
File.open(".git/config", "a") do |f|
f.puts <<-EOF
[remote "heroku"]
url = url = git@heroku.com:your-app-here.git
fetch = +refs/heads/*:refs/remotes/heroku/* # had to change this into remote name instead of app name
EOF
end
known_hosts = File.expand_path("~/.ssh/config")
File.open(known_hosts, "a") do |f|
f.puts <<-EOF
Host heroku.com
StrictHostKeyChecking no
CheckHostIP no
UserKnownHostsFile=/dev/null
EOF
end
@AfolabiOlaoluwa
Copy link

Am having some issues with the user authentication with this. Travis build keep getting a prompt to enter the heroku credentials. how do I fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment