• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

the default GitOps source repository for booting up Jenkins X


Commit MetaInfo

Revisiónf5d7b6eee3c9ac3f49fb3690297d626a041e70a4 (tree)
Tiempo2019-08-29 22:11:11
AutorJames Strachan <james.strachan@gmai...>
CommiterJames Strachan

Log Message

fix: switch to using templating for the parameter schema

so we can properly customise the schema validation based on the git provider kind

Cambiar Resumen

Diferencia incremental

--- /dev/null
+++ b/env/.gitignore
@@ -0,0 +1 @@
1+parameters.schema.json
--- a/env/parameters.schema.json
+++ b/env/parameters.schema.json
@@ -28,7 +28,6 @@
2828 "pipelineUser": {
2929 "type": "object",
3030 "required": [
31- "host",
3231 "username",
3332 "email",
3433 "token"
@@ -115,59 +114,6 @@
115114 }
116115 }
117116 }
118- },
119- {
120- "if": {
121- "properties": {
122- "gitProvider": {
123- "const": "github",
124- "type": "string"
125- }
126- }
127- },
128- "then": {
129- "properties": {
130- "pipelineUser": {
131- "type": "object",
132- "properties": {
133- "github": {
134- "type": "object",
135- "required": [
136- "host",
137- "username",
138- "email",
139- "token"
140- ],
141- "properties": {
142- "host": {
143- "type": "string",
144- "const": "github.com"
145- },
146- "username": {
147- "type": "string",
148- "title": "Pipeline bot Git username",
149- "description": "The Git user that will perform git operations inside a pipeline. It should be a user within the Git organisation/owner where environment repositories will live. This is normally a bot."
150- },
151- "email": {
152- "type": "string",
153- "title": "Pipeline bot Git email address",
154- "description": "The email address of the Git user that will perform git operations inside a pipeline."
155- },
156- "token": {
157- "type": "string",
158- "format": "token",
159- "title": "Pipeline bot Git token",
160- "description": "A token for the Git user that will perform git operations inside a pipeline. This includes environment repository creation, and so this token should have full repository permissions. To create a token go to https://github.com/settings/tokens/new?scopes=repo,read:user,read:org,user:email,write:repo_hook,delete_repo then enter a name, click Generate token, and copy and paste the token into this prompt.",
161- "minLength": 40,
162- "maxLength": 40,
163- "pattern": "^[0-9a-f]{40}$"
164- }
165- }
166- }
167- }
168- }
169- }
170- }
171117 }
172118 ]
173119 }
--- /dev/null
+++ b/env/parameters.tmpl.schema.json
@@ -0,0 +1,149 @@
1+
2+{
3+ "$id": "https:/jenkins-x.io/tests/descriptionAndTitle.schema.json",
4+ "$schema": "http://json-schema.org/draft-07/schema#",
5+ "description": "install values.yaml",
6+ "type": "object",
7+ "properties": {
8+ "adminUser": {
9+ "type": "object",
10+ "required": [
11+ "username",
12+ "password"
13+ ],
14+ "properties": {
15+ "username": {
16+ "type": "string",
17+ "title": "Jenkins X Admin Username",
18+ "description": "The Admin Username will be used by all services installed by Jenkins X",
19+ "default": "admin"
20+ },
21+ "password": {
22+ "type": "string",
23+ "format": "password",
24+ "title": "Jenkins X Admin Password",
25+ "description": "The Admin Password will be used by all services installed by Jenkins X"
26+ }
27+ }
28+ },
29+ "pipelineUser": {
30+ "type": "object",
31+ "required": [
32+ "username",
33+ "email",
34+ "token"
35+ ],
36+ "properties": {
37+ "username": {
38+ "type": "string",
39+ "title": "Pipeline bot Git username",
40+ "description": "The Git user that will perform git operations inside a pipeline. It should be a user within the Git organisation/owner where environment repositories will live. This is normally a bot."
41+ },
42+ "email": {
43+ "type": "string",
44+ "title": "Pipeline bot Git email address",
45+ "description": "The email address of the Git user that will perform git operations inside a pipeline."
46+ },
47+{{- if eq .GitKind "github" }}
48+ "token": {
49+ "type": "string",
50+ "format": "token",
51+ "title": "Pipeline bot Git token",
52+ "description": "A token for the Git user that will perform git operations inside a pipeline. This includes environment repository creation, and so this token should have full repository permissions. To create a token go to {{ .GitServer }}/settings/tokens/new?scopes=repo,read:user,read:org,user:email,write:repo_hook,delete_repo then enter a name, click Generate token, and copy and paste the token into this prompt.",
53+ "minLength": 40,
54+ "maxLength": 40,
55+ "pattern": "^[0-9a-f]{40}$"
56+ }
57+{{- else if eq .GitKind "bitbucketserver" }}
58+ "token": {
59+ "type": "string",
60+ "format": "token",
61+ "title": "Pipeline bot Git token",
62+ "description": "A token for the Git user that will perform git operations inside a pipeline. This includes environment repository creation, and so this token should have full repository permissions. To create a token go to {{ .GitServer }}/plugins/servlet/access-tokens/manage then enter a name, click Generate token, and copy and paste the token into this prompt.",
63+ "minLength": 8,
64+ "maxLength": 50
65+ }
66+{{- else if eq .GitKind "gitlab" }}
67+ "token": {
68+ "type": "string",
69+ "format": "token",
70+ "title": "Pipeline bot Git token",
71+ "description": "A token for the Git user that will perform git operations inside a pipeline. This includes environment repository creation, and so this token should have full repository permissions. To create a token go to {{ .GitServer }}/profile/personal_access_tokens then enter a name, click Generate token, and copy and paste the token into this prompt.",
72+ "minLength": 8,
73+ "maxLength": 50
74+ }
75+{{- else }}
76+ "token": {
77+ "type": "string",
78+ "format": "token",
79+ "title": "Pipeline bot Git token",
80+ "description": "A token for the Git user that will perform git operations inside a pipeline. This includes environment repository creation, and so this token should have full repository permissions. To create a token go to {{ .GitServer }}/settings/tokens/new?scopes=repo,read:user,read:org,user:email,write:repo_hook,delete_repo then enter a name, click Generate token, and copy and paste the token into this prompt.",
81+ "minLength": 8,
82+ "maxLength": 50
83+ }
84+{{- end }}
85+ }
86+ },
87+ "prow": {
88+ "type": "object",
89+ "properties": {
90+ "hmacToken": {
91+ "type": "string",
92+ "format": "token",
93+ "title": "HMAC token, used to validate incoming webhooks. Press enter to use the generated token",
94+ "description": "The HMAC token is used by the Git Provider to create a hash signature for each webhook, and by Jenkins X to validate that the signature is from a trusted source. It's normally best to have Jenkins X generate a token for you if you don't already have one. You'll need to save it and use it with all the webhooks configured in your git provider for Jenkins X. For more detail see: https://en.wikipedia.org/wiki/HMAC",
95+ "default": "<generated:hmac>"
96+ }
97+ }
98+ },
99+ "enableDocker": {
100+ "type": "boolean",
101+ "title": "Do you want to configure an external Docker Registry?",
102+ "description": "By default Jenkins X will use the docker registry from the cloud provider. If you want to configure an external docker registry such as Docker Hub or your own existing docker registry enter Y"
103+ }
104+ },
105+ "allOf": [
106+ {
107+ "if": {
108+ "properties": {
109+ "enableDocker": {
110+ "const": "true",
111+ "type": "boolean"
112+ }
113+ }
114+ },
115+ "then": {
116+ "properties": {
117+ "docker": {
118+ "type": "object",
119+ "required": [
120+ "url",
121+ "username",
122+ "password"
123+ ],
124+ "properties": {
125+ "url": {
126+ "type": "string",
127+ "title": "Docker Registry Url",
128+ "default": "https://index.docker.io/v1/",
129+ "description": "The URL of the external docker registry",
130+ "format": "uri"
131+ },
132+ "username": {
133+ "type": "string",
134+ "title": "Docker Registry username",
135+ "description": "The username used to access the external docker registry"
136+ },
137+ "password": {
138+ "type": "string",
139+ "format": "password",
140+ "title": "Docker Registry password",
141+ "description": "The password used to access the external docker registry"
142+ }
143+ }
144+ }
145+ }
146+ }
147+ }
148+ ]
149+}