Make DOCKER_TARGET a buid time argument only. #23076
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: mozilla/addons#15361
Description
Define
TARGET
setting reading the docker target from build info.Context
It is very subtle, but extremely problematic to rely on an environmnet variable for
DOCKER_TARGET
. This value is mostly relevant during build time, it literally determines which stage of the docker image to build to. The actual state cannot be changed, but environment variables can be freely changed whenever you want.Since we are relying on this value to know what kind of checks to run or what features might be enabled we must use a value that is hard coded during the build. that is what the build-info.json is meant for.
Testing
Make up with a given target "production" or "development"
Shell into the container
Print the environmnet
Django shell it up
Get that TARGET setting
Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.