While deploying an update to Jewelbots.com (transitioning the site over to node.js so that we can use Mailchimp’s server-side API), I ran into an issue where Elastic Beanstalk’s integrated eb deploy
feature will only deploy files git is tracking when a git repository is present.
If you want to deploy API Keys, but don’t want them tracked in git, this presents a problem.
I took to twitter to ask for help:
How do other devs handle custom files that aren't checked into source control (like keys) but need to be deployed with eb deploy? #aws
— George Stocker (@gortok) May 31, 2015
The responses trickled in:
@gortok only answer I have found is have a private repo and when you push to public repo exclude keys, want something better though
— SQL & CI = happyland (@EdDebug) May 31, 2015
This is… sub-optimal, to say the least.
Luckily, a member of the Elastic Beanstalk team responded:
@gortok add a .ebignore file.
— Nick Humrich (@nhumrich) May 31, 2015
And further elaborated:
@gortok http://t.co/iRU1g5ZY6q
— Nick Humrich (@nhumrich) May 31, 2015
@gortok yes, ebignore overrides gitignore, so just add an ebignore with ".git/" in it.
— Nick Humrich (@nhumrich) May 31, 2015
Excellent! By adding an .ebignore
file that is set up to ignore files I don’t want deployed, I can ensure that all of my project files are deployed. The .ebignore is in fact, an .ebdontdeploy.
This is a very new development; so new that it was still being requested in April. My hat’s off to the Elastic Beanstalk team (and especially Nick Humrich) for cluing me in to it. I only wish it was linked to by other parts of the Elastic Beanstalk 3.0 CLI docs.
If you need to deploy files that aren’t tracked by git to elastic beanstalk, .ebignore is the answer.