从弹性beanstalk部署中排除目录

时间:2022-08-25 08:36:19

I have some directories that I would like to be in my local git repository, but NOT in the remote repository when I deploy to my beanstalk environment.

我有一些目录,我想在我的本地git存储库中,但是当我部署到我的beanstalk环境时,不在远程存储库中。

I have googled a bit, and found a few years old posts like this:

我用Google搜索了一下,发现这样几年的帖子:

http://blog.beanstalkapp.com/post/38164899272/patterns-for-excluded-deployment-paths

http://blog.beanstalkapp.com/post/38164899272/patterns-for-excluded-deployment-paths

that explain that there is this option somewhere, but I have looked everywhere and cannot find it. I think it must still be there and possibly it's been moved around?

这解释了某个地方有这个选项,但我到处寻找并找不到它。我认为它一定还在那里,可能它已被移动了?

If that helps (though it probably doesn't make any difference), I've got an environment based on the sample node.js application. Where is this option?

如果这有帮助(虽然它可能没有任何区别),我有一个基于示例node.js应用程序的环境。这个选项在哪里?

Is it possible to do it in a config file in the .ebextensions folder instead?

是否可以在.ebextensions文件夹中的配置文件中执行此操作?

2 个解决方案

#1


40  

With the current eb cli v3.x elastic beanstalk supports the .ebignore file. It follows the same format as a .gitignore file and it replaces it on deploy.

使用当前的eb cli v3.x弹性beanstalk支持.ebignore文件。它遵循与.gitignore文件相同的格式,并在部署时替换它。

If you want to use .ebignore then you need to copy your .gitignore into the file and then add the extra exclusions to the file. If you edit your .gitignore file in the future you will need to replicate any changes into you .ebignore file.

如果要使用.ebignore,则需要将.gitignore复制到文件中,然后将额外的排除项添加到文件中。如果您以后编辑.gitignore文件,则需要将任何更改复制到.ebignore文件中。

See elastic beanstalk docs for more details

有关更多详细信息,请参阅弹性beanstalk文档

#2


14  

Unfortunately, this is not currently possible. The best workaround right now is to create your own zip and tell the CLI to use it instead. You can do this by adding the following lines to .elasticbeanstalk/config.yml

不幸的是,这目前还不可行。现在最好的解决方法是创建自己的zip并告诉CLI使用它。您可以通过将以下行添加到.elasticbeanstalk / config.yml来完成此操作

deploy:
  artifact: /path/to/file.zip

If you can script your zip, you could add an alias like

如果您可以编写zip脚本,可以添加别名

alias ebdeploy="zip {your zip stuff here}; eb deploy"

#1


40  

With the current eb cli v3.x elastic beanstalk supports the .ebignore file. It follows the same format as a .gitignore file and it replaces it on deploy.

使用当前的eb cli v3.x弹性beanstalk支持.ebignore文件。它遵循与.gitignore文件相同的格式,并在部署时替换它。

If you want to use .ebignore then you need to copy your .gitignore into the file and then add the extra exclusions to the file. If you edit your .gitignore file in the future you will need to replicate any changes into you .ebignore file.

如果要使用.ebignore,则需要将.gitignore复制到文件中,然后将额外的排除项添加到文件中。如果您以后编辑.gitignore文件,则需要将任何更改复制到.ebignore文件中。

See elastic beanstalk docs for more details

有关更多详细信息,请参阅弹性beanstalk文档

#2


14  

Unfortunately, this is not currently possible. The best workaround right now is to create your own zip and tell the CLI to use it instead. You can do this by adding the following lines to .elasticbeanstalk/config.yml

不幸的是,这目前还不可行。现在最好的解决方法是创建自己的zip并告诉CLI使用它。您可以通过将以下行添加到.elasticbeanstalk / config.yml来完成此操作

deploy:
  artifact: /path/to/file.zip

If you can script your zip, you could add an alias like

如果您可以编写zip脚本,可以添加别名

alias ebdeploy="zip {your zip stuff here}; eb deploy"