From 6ab1f55197b0e75f5e40baa26fea7edb4644ad9d Mon Sep 17 00:00:00 2001 From: Julien Date: Wed, 28 Aug 2024 17:13:06 -0400 Subject: [PATCH] push first working set --- charts/atlantis/templates/NOTES.txt | 1 + charts/atlantis/templates/secret-webhook.yaml | 3 +++ charts/atlantis/templates/statefulset.yaml | 20 ++++++++++++++++ charts/atlantis/values.schema.json | 23 +++++++++++++++++++ charts/atlantis/values.yaml | 3 +++ 5 files changed, 50 insertions(+) diff --git a/charts/atlantis/templates/NOTES.txt b/charts/atlantis/templates/NOTES.txt index 58d7f234..c3afc8db 100644 --- a/charts/atlantis/templates/NOTES.txt +++ b/charts/atlantis/templates/NOTES.txt @@ -20,5 +20,6 @@ 2. Atlantis will not start successfully unless at least one of the following sets of credentials are specified (see values.yaml for detailed usage): - github - githubApp + - gitea - gitlab - bitbucket \ No newline at end of file diff --git a/charts/atlantis/templates/secret-webhook.yaml b/charts/atlantis/templates/secret-webhook.yaml index 68dfab97..b7af5637 100644 --- a/charts/atlantis/templates/secret-webhook.yaml +++ b/charts/atlantis/templates/secret-webhook.yaml @@ -18,6 +18,9 @@ data: github_token: {{ required "github.token is required if github configuration is specified." .Values.github.token | b64enc }} github_secret: {{ required "github.secret is required if github configuration is specified." .Values.github.secret | b64enc }} {{- end }} + {{- if .Values.gitea.user }} + gitea_token: {{ required "gitea.token is required if gitea configuration is specified." .Values.gitea.token | b64enc }} + {{- end }} {{- if .Values.gitlab }} gitlab_token: {{ required "gitlab.token is required if gitlab configuration is specified." .Values.gitlab.token | b64enc }} gitlab_secret: {{ required "gitlab.secret is required if gitlab configuration is specified." .Values.gitlab.secret | b64enc }} diff --git a/charts/atlantis/templates/statefulset.yaml b/charts/atlantis/templates/statefulset.yaml index f137eb19..f436c7c5 100644 --- a/charts/atlantis/templates/statefulset.yaml +++ b/charts/atlantis/templates/statefulset.yaml @@ -387,6 +387,26 @@ spec: value: "/var/github-app/key.pem" {{- end }} {{- end }} + {{- if .Values.gitea.user }} + - name: ATLANTIS_GITEA_USER + value: {{ required "gitea.user is required if gitea configuration is specified." .Values.gitea.user }} + - name: ATLANTIS_GITEA_TOKEN + valueFrom: + secretKeyRef: + name: {{ template "atlantis.vcsSecretName" . }} + key: gitea_token + {{- if .Values.gitea.baseURL }} + - name: ATLANTIS_GITEA_BASE_URL + value: {{ .Values.gitea.baseURL }} + {{- end }} + {{- if .Values.gitea.secret }} + - name: ATLANTIS_GITEA_WEBHOOK_SECRET + valueFrom: + secretKeyRef: + name: {{ template "atlantis.vcsSecretName" . }} + key: gitea_secret + {{- end }} + {{- end }} {{- if .Values.gitlab }} - name: ATLANTIS_GITLAB_USER value: {{ required "gitlab.user is required if gitlab configuration is specified." .Values.gitlab.user }} diff --git a/charts/atlantis/values.schema.json b/charts/atlantis/values.schema.json index ce3e7554..d7808d09 100644 --- a/charts/atlantis/values.schema.json +++ b/charts/atlantis/values.schema.json @@ -113,6 +113,29 @@ }, "additionalProperties": false }, + "gitea": { + "type": "object", + "description": "Gitea settings", + "properties": { + "user": { + "type": "string", + "description": "Name of the Atlantis Gitea user." + }, + "token": { + "type": "string", + "description": "Token of the Atlantis Gitea user." + }, + "secret": { + "type": "string", + "description": "Webhook secret for the Atlantis Gitea integration." + }, + "baseURL": { + "type": "string", + "description": "Base URL of Gitea Server installation." + } + }, + "additionalProperties": false + }, "gitlab": { "type": "object", "description": "GitLab settings", diff --git a/charts/atlantis/values.yaml b/charts/atlantis/values.yaml index ab8c3cf3..eec43685 100644 --- a/charts/atlantis/values.yaml +++ b/charts/atlantis/values.yaml @@ -50,6 +50,9 @@ githubApp: {} # -----END PRIVATE KEY----- # secret: baz +gitea: {} + + # -- If using GitLab, please enter your values as follows. # The 'hostname' key is exclusive to GitLab Enterprise installations. # The chart will perform the base64 encoding for you for values that are stored in secrets.