I have an Elastic Beanstalk Python Application.
So I already made my build script where I do generate a deploy.zip file that I do deploy into EB. It does work just as it suppose to.
So after building my script for building an artifact (my deploy.zip) that is compatible with EB, I began to work on configuring EB cli for using eb deploy
in my gitlab-ci, so it will deploy to EB homologation server when there be a commit on development branch and into EB production when get into master. ( right now I'm just working on homologation server).
So I did read the documentation and notice that eb would build the artifactory by itself. But as I already had my own build script, this Deploying an Artifact Instead of the Project Folder so I made a .elasticbeanstalk
folder and a config.yml
in it with the follow configuration.
deploy:
artifact: deploy.zip
So I did a eb init
, did set everything (region, id, key and selected my existing project.
When I did eb deploy
it worked just as it suppose to. So I did suspect that eb
was making de artifactory by itself, so I checked the config file and notice that eb
had add a bunch of other config into the file, my deploy config was there, so for another test I did deleted my deploy.zip
so when I did a eb deploy
it failed just as it suppose to.
Until this point everything was running just as I was planning to, so I did a git status
for checking before adding the .elasticbeanstalk
folder into git. For my surprise the folder was not been listed and the .gitignore
file was changed. When checking the .gitignore
it had the .elasticbeanstalk
in it.
So it got me alert about if I should add this folder into the git, as de default behavior of eb
is to add it into ignore.
I was planning to commit the eb configurations and set the keys using environment variables as is says in Configuration Settings and Precedence session.
I've tried to run eb deploy
without the configurations just passing env vars before the command, something like AWSAccessKeyId=<access_key> AWSSecretKey=<secret_key> eb deploy
, but it says that I should run eb init
before it.
So shouldn't I track my eb
configuration in my git repo? If not, how should I procede for a CI deploy with EB ?