Skip to content

Commit 040eddb

Browse files
committed
🔧(project) change env.d system by using local files
We had lot of problems with the previous env.d system. Users were often confused by the need to change the env.d files manually, leading to issues when using the project locally. This commit introduces a new system that uses .env.local files, which are automatically created and can be modified by users without affecting the original env.d files. This should simplify the development process and reduce confusion by removing the need to manually edit env.d files.
1 parent f2e5430 commit 040eddb

File tree

11 files changed

+21
-26
lines changed

11 files changed

+21
-26
lines changed

.github/workflows/impress-frontend.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
fail-on-cache-miss: true
8181

8282
- name: Set e2e env variables
83-
run: cat env.d/development/common.e2e.dist >> env.d/development/common.dist
83+
run: cat env.d/development/common.e2e >> env.d/development/common.local
8484

8585
- name: Install Playwright Browsers
8686
run: cd src/frontend/apps/e2e && yarn install --frozen-lockfile && yarn install-playwright chromium
@@ -119,7 +119,7 @@ jobs:
119119
fail-on-cache-miss: true
120120

121121
- name: Set e2e env variables
122-
run: cat env.d/development/common.e2e.dist >> env.d/development/common.dist
122+
run: cat env.d/development/common.e2e >> env.d/development/common.local
123123

124124
- name: Install Playwright Browsers
125125
run: cd src/frontend/apps/e2e && yarn install --frozen-lockfile && yarn install-playwright firefox webkit chromium

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ venv/
4040
ENV/
4141
env.bak/
4242
venv.bak/
43-
env.d/development/*
44-
!env.d/development/*.dist
43+
env.d/development/*.local
4544
env.d/terraform
4645

4746
# npm

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to
1717
### Changed
1818

1919
- ⚡️(docker) Optimize Dockerfile to use apk with --no-cache #743
20+
- 🔧(project) change env.d system by using local files #1200
2021

2122
### Fixed
2223

Makefile

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ data/static:
6767

6868
# -- Project
6969

70-
create-env-files: ## Copy the dist env files to env files
71-
create-env-files: \
72-
env.d/development/common \
73-
env.d/development/crowdin \
74-
env.d/development/postgresql \
75-
env.d/development/kc_postgresql
76-
.PHONY: create-env-files
70+
create-env-local-files: ## create env.local files in env.d/development
71+
create-env-local-files:
72+
@touch env.d/development/crowdin.local
73+
@touch env.d/development/common.local
74+
@touch env.d/development/postgresql.local
75+
@touch env.d/development/kc_postgresql.local
76+
.PHONY: create-env-local-files
7777

7878
pre-bootstrap: \
7979
data/media \
8080
data/static \
81-
create-env-files
81+
create-env-local-files
8282
.PHONY: pre-bootstrap
8383

8484
post-bootstrap: \
@@ -258,20 +258,6 @@ resetdb: ## flush database and create a superuser "admin"
258258
@${MAKE} superuser
259259
.PHONY: resetdb
260260

261-
env.d/development/common:
262-
cp -n env.d/development/common.dist env.d/development/common
263-
264-
env.d/development/postgresql:
265-
cp -n env.d/development/postgresql.dist env.d/development/postgresql
266-
267-
env.d/development/kc_postgresql:
268-
cp -n env.d/development/kc_postgresql.dist env.d/development/kc_postgresql
269-
270-
# -- Internationalization
271-
272-
env.d/development/crowdin:
273-
cp -n env.d/development/crowdin.dist env.d/development/crowdin
274-
275261
crowdin-download: ## Download translated message from crowdin
276262
@$(COMPOSE_RUN_CROWDIN) download -c crowdin/config.yml
277263
.PHONY: crowdin-download

compose-e2e.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ services:
2424
restart: unless-stopped
2525
env_file:
2626
- env.d/development/common
27+
- env.d/development/common.local
2728
ports:
2829
- "4444:4444"

compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
retries: 300
1111
env_file:
1212
- env.d/development/postgresql
13+
- env.d/development/postgresql.local
1314
ports:
1415
- "15432:5432"
1516

@@ -66,7 +67,9 @@ services:
6667
- DJANGO_CONFIGURATION=Development
6768
env_file:
6869
- env.d/development/common
70+
- env.d/development/common.local
6971
- env.d/development/postgresql
72+
- env.d/development/postgresql.local
7073
ports:
7174
- "8071:8000"
7275
volumes:
@@ -91,7 +94,9 @@ services:
9194
- DJANGO_CONFIGURATION=Development
9295
env_file:
9396
- env.d/development/common
97+
- env.d/development/common.local
9498
- env.d/development/postgresql
99+
- env.d/development/postgresql.local
95100
volumes:
96101
- ./src/backend:/app
97102
- ./data/static:/data/static
@@ -135,6 +140,7 @@ services:
135140
- ".:/app"
136141
env_file:
137142
- env.d/development/crowdin
143+
- env.d/development/crowdin.local
138144
user: "${DOCKER_USER:-1000}"
139145
working_dir: /app
140146

@@ -156,6 +162,7 @@ services:
156162
restart: unless-stopped
157163
env_file:
158164
- env.d/development/common
165+
- env.d/development/common.local
159166
ports:
160167
- "4444:4444"
161168
volumes:
@@ -174,6 +181,7 @@ services:
174181
- "5433:5432"
175182
env_file:
176183
- env.d/development/kc_postgresql
184+
- env.d/development/kc_postgresql.local
177185

178186
keycloak:
179187
image: quay.io/keycloak/keycloak:20.0.1
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)