0

Unable to Push deployment from Github repository to CloudClontrol using Travis CI, Below is the log:

Deploying application
Warning: Permanently added 'cloudcontrolled.com' (RSA) to the list of known hosts.
To ssh://xxx.git
! [rejected]        HEAD -> master (fetch first)
error: failed to push some refs to 'ssh://awesomeblog@cloudcontrolled.com/repository.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details

Is there a way to force hard push overriding the status of remote git?

In case you need to see full logs, you can find it here https://s3.amazonaws.com/archive.travis-ci.org/jobs/26330194/log.txt. Note that the relevant log is at the end.

prasun
  • 7,073
  • 9
  • 41
  • 59
  • Well, have you done a git pull as requested? – Kuba hasn't forgotten Monica May 29 '14 at 20:35
  • two repositories are in a very different state, would doing a pull be dangerous? Also, I had similar situations while deploying to Heroku and Openshift, where git state of heroku/Openshift was completely different than the state of my github repo, but still it was able to deploy the code with Hard push – prasun May 29 '14 at 20:37
  • There is reciprocity in play: if a pull is dangerous, so is a push. I can't really see how it could be any other way. – Kuba hasn't forgotten Monica May 29 '14 at 20:42
  • I would manually push once to cloud control with your current code with `git push -f` and then travis-ci should be able to push again. – joshua-anderson Jun 02 '14 at 22:01

1 Answers1

0

I was able to get this problem solved with new feature released by Travis CI,

they have added -f option while doing a push during deploy.

All you need to do is add

edge: true

option for Cloudcontrol deployment as described here http://docs.travis-ci.com/user/deployment/#Other-Providers , in your yml file

prasun
  • 7,073
  • 9
  • 41
  • 59