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

feat(autodevops): Add NEXTAUTH_URL as default env variable #847

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -84,6 +84,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
initContainers:
- env:
- name: WAIT_FOR_RETRIES
Expand Down
Expand Up @@ -84,6 +84,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
initContainers:
- env:
- name: WAIT_FOR_RETRIES
Expand Down
Expand Up @@ -84,6 +84,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
initContainers:
- env:
- name: WAIT_FOR_RETRIES
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -84,6 +84,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
initContainers:
- env:
- name: WAIT_FOR_RETRIES
Expand Down
Expand Up @@ -84,6 +84,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://preprod-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://preprod-sample-kosko.dev2.fabrique.social.gouv.fr
initContainers:
- env:
- name: WAIT_FOR_RETRIES
Expand Down
Expand Up @@ -84,6 +84,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://sample-kosko.dev2.fabrique.social.gouv.fr
initContainers:
- env:
- name: WAIT_FOR_RETRIES
Expand Down
Expand Up @@ -85,6 +85,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://sample-kosko-e2e-branch.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://sample-kosko-e2e-branch.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -365,6 +367,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -671,6 +675,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -387,6 +389,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -387,6 +389,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -82,6 +82,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -82,6 +82,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -82,6 +82,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -82,6 +82,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -82,6 +82,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -82,6 +82,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -85,6 +85,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://sample-kosko-e2e-branch.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://sample-kosko-e2e-branch.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -235,6 +237,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
Expand Up @@ -81,6 +81,8 @@ spec:
env:
- name: APP_BASE_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
- name: NEXTAUTH_URL
value: https://e2e-branch-42-sample-kosko.dev2.fabrique.social.gouv.fr
---
apiVersion: v1
kind: Service
Expand Down
15 changes: 12 additions & 3 deletions templates/autodevops/components/app.ts
Expand Up @@ -94,13 +94,22 @@ export default async (): Manifests => {

ok(deployment);

const frontendUrl = getIngressHost(manifests);

/* pass dynamic deployment URL as env var to the container */
const frontendUrl = new EnvVar({
const APP_BASE_URL = new EnvVar({
name: "APP_BASE_URL",
value: `https://${getIngressHost(manifests)}`,
value: `https://${frontendUrl}`,
});

addEnv({ data: APP_BASE_URL, deployment });

const NEXTAUTH_URL = new EnvVar({
name: "NEXTAUTH_URL",
value: `https://${frontendUrl}`,
});

addEnv({ data: frontendUrl, deployment });
addEnv({ data: NEXTAUTH_URL, deployment });

return manifests;
} else {
Expand Down