deis / builder

Git server and application builder for Deis Workflow
https://deis.com
MIT License
40 stars 41 forks source link

Destroying an app and recreating with same name does not allow for push with same commit #297

Closed jchauncey closed 8 years ago

jchauncey commented 8 years ago

Summary

If you have an app and you did a git push to deploy it. If you destroy that app and recreate it with the same name you cannot repush that same commit.

Replication Steps

  1. Create an application - deis create foo
  2. Deploy the app using - git push deis master
  3. Destroy app - deis destroy -a foo
  4. Recreate app - deis create foo
  5. Try and do a git push
─jonathanchauncey at ENG000637 in ~/projects/deis/example-go on master✔ using ‹2.0.0-p645›
╰─± deis destroy -a foo
 !    WARNING: Potentially Destructive Action
 !    This command will destroy the application: foo
 !    To proceed, type "foo" or re-run this command with --confirm=foo

> foo
Destroying foo...
done in 1s
╭─jonathanchauncey at ENG000637 in ~/projects/deis/example-go on master✔ using ‹2.0.0-p645›
╰─± deis create foo
Creating Application... done, created foo
fatal: remote deis already exists.
To replace the existing git remote entry, run:
  git remote rename deis deis.old && deis git:remote -a foo
Error: exit status 128
╭─jonathanchauncey at ENG000637 in ~/projects/deis/example-go on master✔ using ‹2.0.0-p645›
╰─± git remote remove deis
╭─jonathanchauncey at ENG000637 in ~/projects/deis/example-go on master✔ using ‹2.0.0-p645›
╰─± deis git:remote -a foo
Git remote deis added
╭─jonathanchauncey at ENG000637 in ~/projects/deis/example-go on master✔ using ‹2.0.0-p645›
╰─± git push deis master
Everything up-to-date
jchauncey commented 8 years ago

nevermind. i was able to reproduce this twice but now I cant.

arschles commented 8 years ago

@jchauncey I may be able to explain this. The builder watches the k8s event stream for app removal, and when it sees a Delete event, it deletes the git directory for the app on its filesystem.

It's likely here that you deleted & re-created the app, then git pushed the code before the builder saw the event and deleted the app directory, which would cause the Everything up-to-date message to be shown.