Skip to content

Commit

Permalink
fix(k8s): use env.BASE_URL and fallback on proces.env.BASE_URL (#416)
Browse files Browse the repository at this point in the history
* fix(k8s): use env.BASE_URL and fallback on proces.env.BASE_URL

* pass the BASE_URL through the dev only sitemap-uploader file

Co-authored-by: Douglas DUTEIL <[email protected]>
  • Loading branch information
lionelB and douglasduteil authored Apr 8, 2021
1 parent 0dc9aab commit 5aeef2f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ spec:
exit 1
fi
env:
- name: BASE_URL
env: []
envFrom:
- configMapRef:
name: sitemap-uploader-preprod
Expand Down Expand Up @@ -191,8 +190,7 @@ spec:
exit 1
fi
env:
- name: BASE_URL
env: []
envFrom:
- configMapRef:
name: sitemap-uploader-prod
Expand Down
12 changes: 8 additions & 4 deletions .k8s/components/jobs/sitemap-uploader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ const job = new Job({
command: ["bash"],
args: ["-c", uploadSitemapScript],
env: [
{
name: "BASE_URL",
value: process.env.BASE_URL || env.BASE_URL,
},
...(env.BASE_URL
? [
{
name: "BASE_URL",
value: env.BASE_URL,
},
]
: []),
],
envFrom: [
{
Expand Down
4 changes: 3 additions & 1 deletion .k8s/environments/dev/sitemap-uploader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ BASE_URL = https://xxx-code-travail.dev2.fabrique.social.gouv.fr/
`
);
export default {};
export default {
BASE_URL: process.env.BASE_URL,
};

0 comments on commit 5aeef2f

Please sign in to comment.