Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define the ENV setting for all environments (including test/build/local) #23073

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KevinMind
Copy link
Contributor

@KevinMind KevinMind commented Feb 13, 2025

Fixes: mozilla/addons#15358

Description

Defines a gloabl ENV setting and documents its purpose and meaning.

Testing

You can inspect for build,test,local.

Build

Anywhere in the dockerfile add

RUN echo "env: ${ENV}"

Run the build

make docker_build_web DOCKER_PROGRESS=plain

Expect to see "env: build"

Test

In any test add

print('env', os.environ.get('ENV'))
print('env_setting', settings.ENV)

Expect both to print "test"

Local

run make down && make up (to ensure new compose settings are applied

Check in the terminal

make shell
printenv

Expect ENV=local in there

Check in settings

make djshell
settings.ENV

Expect "local" to be returned

Screenshots

image

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@KevinMind KevinMind requested review from a team and diox and removed request for a team February 13, 2025 11:11
@KevinMind KevinMind force-pushed the kevinmind/addons/153310-static-check branch from 6c2887c to 2f3cbde Compare February 13, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Define ENV for all possible environments.
1 participant