user764357
user764357

Reputation:

eb awscli cant deploy from git directory

I'm getting started with the ElasticBeanstalk AWS CLI and I've changed some of my workflow around. Previously I deployed from a directory above my git repository (which is a clone of a private GitLab directory), and shifted things around.

Before it was structured like this:

-- some_dir
 |-- .ebextensions
 | |- some_files 
 |
 |-- my_git_directory
   |- .git 
   |- some_files 

And when I run eb deploy:

[some_dir] $ eb deploy
... Everything is awesome.

But now, I've moved to try and deploy from the git directory, but things aren't working:

-- some_dir
 |-- my_git_directory
   |-- .ebextensions
   | |- some_files 
   |- .git 
   |- some_files 

[some_dir/my_git_directory] $ eb deploy
... Everything sucks.
ERROR: An error occurred while handling git command.
Error code: 128 Error: fatal: Not a git repository (or any of the parent directories): .git

Now its all busted, and deploy no longer works. I've tried adding a branch and deploying a staged version:

$ eb branch
usage: eb (sub-commands ...) [options ...] {arguments ...}
eb: error: unrecognized arguments: branch

$ eb deploy
ERROR: This branch does not have a default environment. 
You must either specify an environment by typing "deploy my-env-name" or set a default environment by typing "eb use my-env-name".
$ eb use  django-env2

$ eb deploy --staged
... Nope, still busted

Upvotes: 14

Views: 7139

Answers (1)

user764357
user764357

Reputation:

So I got it solved and it is surprisingly basic, but it might help others.

If you move where you are deploying from you need to re-initialise something (not sure what), and it was fixed by running:

eb init

Then everything worked fine again.

Upvotes: 42

Related Questions