我开始使用ElasticBeanstalk AWS CLI,我已经改变了一些工作流程。以前我从我的git存储库上面的目录(它是一个私有GitLab目录的克隆)部署,并转移了一些东西。
之前的结构如下:
-- some_dir
|-- .ebextensions
| |- some_files
|
|-- my_git_directory
|- .git
|- some_files
当我跑eb deploy
时:
[some_dir] $ eb deploy
... Everything is awesome.
但是现在,我已经开始尝试从git目录进行部署,但是事情不起作用:
-- 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
现在它全部被破坏,部署不再有效。我尝试添加branch和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
答案 0 :(得分:22)
所以我得到了解决,这是惊人的基础,但它可能会帮助其他人。
如果您移动到您要部署的位置,则需要重新初始化某些内容(不确定是什么),并通过运行修复它:
eb init
然后一切都恢复正常。