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

[WIP] Gitea Config #416

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/atlantis/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions charts/atlantis/templates/secret-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
20 changes: 20 additions & 0 deletions charts/atlantis/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we aim for gitea.com if not provided?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say, let's use the same logic as the others and leave it empty when not provided:

- 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 }}
Expand Down
23 changes: 23 additions & 0 deletions charts/atlantis/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions charts/atlantis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down