Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deis create in a non-git directory should run with --no-remote #298

Open
bacongobbler opened this issue Mar 27, 2017 · 5 comments
Open

deis create in a non-git directory should run with --no-remote #298

bacongobbler opened this issue Mar 27, 2017 · 5 comments

Comments

@bacongobbler
Copy link
Member

bacongobbler commented Mar 27, 2017

As reported in deis/builder#499, the Heroku client will run heroku create with --no-remote if the directory we are running in is not a git directory:

[~:dom] ⚡  heroku create
Creating app... done, ⬢ thawing-forest-56676
https://thawing-forest-56676.herokuapp.com/ | https://git.heroku.com/thawing-forest-56676.git
[~:dom] ⚡

Whereas with the deis CLI, this does not happen:

[~:dom] ⚡  deis create
Creating Application... done, created haptic-farmland
Error: Error when running 'git remote add deis ssh://[email protected]:2222/haptic-farmland.git'
fatal: Not a git repository (or any of the parent directories): .git

I'm not sure if this was "fixed" in later Heroku versions, but this wasn't the case a few years ago. We should try to mimic Heroku's workflow here, seeing how we are an "open source Heroku".

@Dakuan
Copy link

Dakuan commented Mar 27, 2017

Part of why I found this confusing wasn't just the difference with Heroku's behaviour, it was also conceptual. I'm creating a deis app on a remote box - It didn't seem obvious to me that my location in a local shell would affect that.

I though that deis create would have created a remote repo that I could then point to locally in a separate step if I so wished.

Example work flow

# create deis app for my service
$ deis create 
$ cd my-service
$ git remote add production PATH_TO_DEIS_REPO

Many thanks to all the team @deis, I've been delighted with it all!

@bacongobbler
Copy link
Member Author

bacongobbler commented Mar 27, 2017

Ah I can understand that point of view. While there is a remote git repository stored at the builder, I wouldn't rely on it as a persistent git repo store for your application source code. Leave that for GitHub/BitBucket/your own git server etc.

If the builder is rebooted, the repositories are gone because we don't have them backed by persistent disk or anything. The database WAL logs, registry images, built Heroku tarballs, and build caches are, though. The git repos in the builder are created on-the-fly when you push the local contents of the repository to the builder via git push deis, so they aren't created on builder's end when you do a deis create, either.

Again, this is similar to Heroku... However they DO store it persistently, but nobody in reality uses Heroku as their backing store for their git repos because it requires deploying your app to Heroku on EVERY push, even if you want to push in-progress branches.

Does that help clarify some things?

@Dakuan
Copy link

Dakuan commented Mar 27, 2017

Absolutely, though I never intended to use the git repo for a source control, just as a deployment pathway.

@bacongobbler
Copy link
Member Author

bacongobbler commented Mar 27, 2017

I thought that deis create would have created a remote repo that I could then point to locally in a separate step if I so wished.

For what it's worth, this is do-able, but it requires flipping on a few extra option flags (again, tooting the "Heroku compatibility" horn again):

$ deis create myappname --no-remote
$ deis git:remote --app myappname

This missing functionality in the ticket is the one gap in the matrix we've probably missed in future Heroku updates.

@bacongobbler bacongobbler changed the title deis create in a non-git repo should run with --no-remote deis create in a non-git directory should run with --no-remote Mar 27, 2017
@Cryptophobia
Copy link

This issue was moved to teamhephy/workflow-cli#9

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

No branches or pull requests

3 participants