Code Zip Artifact
The jets deploy
process zips up your project in a code.zip
for deployment. For the most part, the files that are not in .gitignore
are packaged up. Some additional rules are covered below.
Always Keep
If the code is git repo, Jets generates code.zip
artifact that respects the .gitignore
file. All files within in the .gitignore
are excluded from the code.zip
. With exception to the .config.code.always_keep
files. The default is always_keep = ['config/jets/env']
.
config/jets/bootstrap.rb
Jets.bootstrap.configure do
config.code.always_keep = ['config/jets/env'] # default
Hence, the config/jets/env
folder is always copied over as part of the deployment process. This allows you to .gitignore
files like .env*
but copy over config/jets/env/.env
files so the remote runner use the config/jets/env
variable values.
Always Remove
When the project is not a git repo, then Jets uses almost all the files for the code.zip
. Some files will always be removed per:
config/jets/bootstrap.rb
Jets.bootstrap.configure do
config.code.always_remove = ['tmp'] # default
Jets CI .gitignore
If you are using Jets CI, then config/jets/env
may not be in the git repo for the CI run. IE: Even always_keep
won’t work. When using CI, you have to make sure config/jets/env
files are in version control. IE: Check GitHub and confirm it’s there.
If the config/jets/env is not in version control, it’s probably due to a gitignore rule.
Here is an example that allows config/jets/env
files while ignoring .env
at the top level.
.gitignore
# Ignore all environment files except templates
/.env*
!/.env*.erb
Here’s another example of ignoring all .env
files and explicitly allowing /config/jets/env/.env
.gitignore
# Ignore all environment files except /config/jets/env/.env
.env*
!/config/jets/env/*
Make sure the !/config/jets/env/*
line is below any .env
ignores. Otherwise, the .env
ignore will take higher precedence.
Important: Ensure you do not have secret info in config/jets/env
and only have SSM references or safe-to-commit plain text values. Another option is to store all env values in SSM parameters and not use config/jets/env
files. CI will be able to look up the SSM parameters.