From ec2f74c5402a532652acdb0e82dc3a0fe189c709 Mon Sep 17 00:00:00 2001 From: Nicolas Kowenski Date: Thu, 4 Apr 2019 08:30:50 +0100 Subject: [PATCH] [stable/drone] Drone 2.0.0 rc 8 - Creates source-control secret (#11619) * value provides the drone shared secret Signed-off-by: nicolas kowenski * Update Chart.yaml Signed-off-by: nicolas kowenski * fix template path Signed-off-by: nicolas kowenski * Add full-name-source-control secret if sourceControl.secret is not definded. Signed-off-by: nicolas kowenski * use same key defined Signed-off-by: nicolas kowenski * add secret field and description Signed-off-by: nicolas kowenski * helm hint valid Signed-off-by: nicolas kowenski * Update Chart.yaml Signed-off-by: nicolas kowenski * singedcommit Signed-off-by: nicolas kowenski * fix chart yaml error Signed-off-by: nicolas kowenski * fix fw port to pod 80 Signed-off-by: nicolas kowenski * Update Chart.yaml Signed-off-by: nicolas kowenski * Update Chart.yaml Signed-off-by: nicolas kowenski * Update secret documentation, clearer now. Signed-off-by: nicolas kowenski * rename checksum secret file to secrets.yaml Signed-off-by: nicolas kowenski * rename secrets file back to original name Signed-off-by: nicolas kowenski * Merge secret-providers in the single checksumed file Signed-off-by: nicolas kowenski * Update secret field name Signed-off-by: nicolas kowenski --- stable/drone/Chart.yaml | 2 +- stable/drone/templates/NOTES.txt | 2 +- stable/drone/templates/secrets.yaml | 23 +++++++++++++++++++++++ stable/drone/values.yaml | 10 +++++++--- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/stable/drone/Chart.yaml b/stable/drone/Chart.yaml index bc73b2e2fb..a7f1fff291 100644 --- a/stable/drone/Chart.yaml +++ b/stable/drone/Chart.yaml @@ -1,7 +1,7 @@ name: drone home: https://drone.io/ icon: https://drone.io/apple-touch-icon.png -version: 2.0.0-rc.8 +version: 2.0.0-rc.9 appVersion: 1.0.0-rc.5 description: Drone is a Continuous Delivery system built on container technology keywords: diff --git a/stable/drone/templates/NOTES.txt b/stable/drone/templates/NOTES.txt index 97e77196d8..c1077ff78e 100644 --- a/stable/drone/templates/NOTES.txt +++ b/stable/drone/templates/NOTES.txt @@ -29,7 +29,7 @@ Get the Drone URL by running: Get the Drone URL by running: export POD_NAME=$(kubectl get pods -n {{ .Release.Namespace }} -l "component=server,app={{ template "drone.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") echo http://127.0.0.1:8000/ - kubectl -n {{ .Release.Namespace }} port-forward $POD_NAME 8000:8000 + kubectl -n {{ .Release.Namespace }} port-forward $POD_NAME 8000:80 {{- end }} {{- else -}} ############################################################################## diff --git a/stable/drone/templates/secrets.yaml b/stable/drone/templates/secrets.yaml index a3a899c173..144cb3eb30 100644 --- a/stable/drone/templates/secrets.yaml +++ b/stable/drone/templates/secrets.yaml @@ -14,3 +14,26 @@ data: {{ else }} secret: "{{ randAlphaNum 24 | b64enc }}" {{ end }} +--- +{{- if not .Values.sourceControl.secret -}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "drone.sourceControlSecret" . }} + labels: + app: {{ template "drone.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: + {{if .Values.sourceControl.provider}} + {{ if eq .Values.sourceControl.provider "github" }} + {{ .Values.sourceControl.github.clientSecretKey }}: {{ .Values.sourceControl.github.clientSecretValue | b64enc | quote }} + {{- else if eq .Values.sourceControl.provider "gitlab" -}} + {{ .Values.sourceControl.gitlab.clientSecretKey }}: {{ .Values.sourceControl.gitlab.clientSecretValue | b64enc | quote }} + {{- else if eq .Values.sourceControl.provider "bitbucketCloud" -}} + {{ .Values.sourceControl.bitbucketCloud.clientSecretKey }}: {{ .Values.sourceControl.bitbucketCloud.clientSecretValue | b64enc | quote }} + {{ end }} + {{ end }} +{{- end -}} diff --git a/stable/drone/values.yaml b/stable/drone/values.yaml index 124b262146..f11bacb5b2 100644 --- a/stable/drone/values.yaml +++ b/stable/drone/values.yaml @@ -80,15 +80,18 @@ sourceControl: secret: ## Fill in the correct values for your chosen source control provider ## Any key in this list with the suffix `Key` will be fetched from the - ## secret named above, if not provided the secret will default to - ## `-source-control` + ## secret named above, if not provided the secret it will be created as + ## `-source-control` using for the key "ClientSecretKey" and + # "clientSecretValue" for the value. Be awere to not leak shis file with your password github: clientID: clientSecretKey: clientSecret + clientSecretValue: server: https://github.com gitlab: clientID: clientSecretKey: clientSecret + clientSecretValue: server: gitea: server: @@ -96,7 +99,8 @@ sourceControl: server: bitbucketCloud: clientID: - clientSecret: clientSecret + clientSecretKey: clientSecret + clientSecretValue: bitbucketServer: server: consumerKey: consumerKey