Skip to content

Commit 472ea2f

Browse files
committed
Add PIP_INDEX_URL option and fix required parameter issue
The new PIP_INDEX_URL parameter is added to allow custom PyPi mirror URL to be used during the build process. There are several paramaters that are required but didn't listed as requested (*). Now, they are marked as required to be explicit. Signed-off-by: Vu Dinh <[email protected]>
1 parent 70d2861 commit 472ea2f

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

openshift/templates/django-postgresql.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@
8484
"kind": "ImageStreamTag",
8585
"namespace": "${NAMESPACE}",
8686
"name": "python:3.4"
87-
}
87+
},
88+
"env": [
89+
{
90+
"name": "PIP_INDEX_URL",
91+
"value": "${PIP_INDEX_URL}"
92+
}
93+
]
8894
}
8995
},
9096
"output": {
@@ -359,24 +365,28 @@
359365
{
360366
"name": "NAMESPACE",
361367
"displayName": "Namespace",
368+
"required": true,
362369
"description": "The OpenShift Namespace where the ImageStream resides.",
363370
"value": "openshift"
364371
},
365372
{
366373
"name": "MEMORY_LIMIT",
367374
"displayName": "Memory Limit",
375+
"required": true,
368376
"description": "Maximum amount of memory the Django container can use.",
369377
"value": "512Mi"
370378
},
371379
{
372380
"name": "MEMORY_POSTGRESQL_LIMIT",
373381
"displayName": "Memory Limit (PostgreSQL)",
382+
"required": true,
374383
"description": "Maximum amount of memory the PostgreSQL container can use.",
375384
"value": "512Mi"
376385
},
377386
{
378387
"name": "SOURCE_REPOSITORY_URL",
379388
"displayName": "Git Repository URL",
389+
"required": true,
380390
"description": "The URL of the repository with your application source code.",
381391
"value": "https://github.com/openshift/django-ex.git"
382392
},
@@ -406,22 +416,26 @@
406416
{
407417
"name": "DATABASE_SERVICE_NAME",
408418
"displayName": "Database Service Name",
419+
"required": true,
409420
"value": "postgresql"
410421
},
411422
{
412423
"name": "DATABASE_ENGINE",
413424
"displayName": "Database Engine",
425+
"required": true,
414426
"description": "Database engine: postgresql, mysql or sqlite (default).",
415427
"value": "postgresql"
416428
},
417429
{
418430
"name": "DATABASE_NAME",
419431
"displayName": "Database Name",
432+
"required": true,
420433
"value": "default"
421434
},
422435
{
423436
"name": "DATABASE_USER",
424437
"displayName": "Database Username",
438+
"required": true,
425439
"value": "django"
426440
},
427441
{
@@ -441,6 +455,12 @@
441455
"description": "Set this to a long random string.",
442456
"generate": "expression",
443457
"from": "[\\w]{50}"
458+
},
459+
{
460+
"name": "PIP_INDEX_URL",
461+
"displayName": "Custom PyPi Index URL",
462+
"description": "The custom PyPi index URL",
463+
"value": ""
444464
}
445465
]
446466
}

openshift/templates/django.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@
8484
"kind": "ImageStreamTag",
8585
"namespace": "${NAMESPACE}",
8686
"name": "python:3.4"
87-
}
87+
},
88+
"env": [
89+
{
90+
"name": "PIP_INDEX_URL",
91+
"value": "${PIP_INDEX_URL}"
92+
}
93+
]
8894
}
8995
},
9096
"output": {
@@ -233,18 +239,21 @@
233239
{
234240
"name": "NAMESPACE",
235241
"displayName": "Namespace",
242+
"required": true,
236243
"description": "The OpenShift Namespace where the ImageStream resides.",
237244
"value": "openshift"
238245
},
239246
{
240247
"name": "MEMORY_LIMIT",
241248
"displayName": "Memory Limit",
249+
"required": true,
242250
"description": "Maximum amount of memory the container can use.",
243251
"value": "512Mi"
244252
},
245253
{
246254
"name": "SOURCE_REPOSITORY_URL",
247255
"displayName": "Git Repository URL",
256+
"required": true,
248257
"description": "The URL of the repository with your application source code.",
249258
"value": "https://github.com/openshift/django-ex.git"
250259
},
@@ -303,6 +312,12 @@
303312
"description": "Set this to a long random string.",
304313
"generate": "expression",
305314
"from": "[\\w]{50}"
315+
},
316+
{
317+
"name": "PIP_INDEX_URL",
318+
"displayName": "Custom PyPi Index URL",
319+
"description": "The custom PyPi index URL",
320+
"value": ""
306321
}
307322
]
308323
}

0 commit comments

Comments
 (0)