Skip to content

Commit

Permalink
Unshallow before Heroku git deployment
Browse files Browse the repository at this point in the history
Heroku rejects pushes from a shallow clone like ours since Heroku
may not have all the objects necessary to build the application
reliably.
  • Loading branch information
BanzaiMan committed Sep 30, 2016
1 parent 3d1b782 commit b124e8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/dpl/provider/heroku/git.rb
Expand Up @@ -11,6 +11,9 @@ def git_url
def push_app
git_remote = options[:git] || git_url
write_netrc if git_remote.start_with?("https://")
log "$ git fetch origin $TRAVIS_BRANCH --unshallow"
context.shell "git fetch origin $TRAVIS_BRANCH --unshallow"
log "$ git push #{git_remote} HEAD:refs/heads/master -f"
context.shell "git push #{git_remote} HEAD:refs/heads/master -f"
end

Expand Down
1 change: 1 addition & 0 deletions spec/provider/heroku_git_spec.rb
Expand Up @@ -72,6 +72,7 @@
describe "#push_app" do
example do
provider.options[:git] = "git://something"
expect(provider.context).to receive(:shell).with("git fetch origin $TRAVIS_BRANCH --unshallow")
expect(provider.context).to receive(:shell).with("git push git://something HEAD:refs/heads/master -f")
provider.push_app
expect(provider.context.env['GIT_HTTP_USER_AGENT']).to include("dpl/#{DPL::VERSION}")
Expand Down

0 comments on commit b124e8e

Please sign in to comment.