2015-06-01 18:43:32 +02:00
{
"kind" : "Template" ,
2015-06-11 17:19:47 +02:00
"apiVersion" : "v1" ,
2015-06-01 18:43:32 +02:00
"metadata" : {
2015-06-11 21:05:29 +02:00
"name" : "django-example" ,
2015-06-01 18:43:32 +02:00
"annotations" : {
2016-10-24 22:33:48 +02:00
"openshift.io/display-name" : "Django" ,
2018-07-24 17:39:33 +02:00
"description" : "An example Django application with no database. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/django-ex/blob/master/README.md." ,
2016-02-24 21:44:44 +01:00
"tags" : "quickstart,python,django" ,
2017-02-14 20:41:32 +01:00
"iconClass" : "icon-python" ,
2017-10-19 14:42:05 +02:00
"openshift.io/long-description" : "This template defines resources needed to develop a Django based application, including a build configuration and application deployment configuration. It does not include a database." ,
"openshift.io/provider-display-name" : "Red Hat, Inc." ,
2018-07-24 17:39:33 +02:00
"openshift.io/documentation-url" : "https://github.com/sclorg/django-ex" ,
2017-11-07 20:03:41 +01:00
"openshift.io/support-url" : "https://access.redhat.com" ,
"template.openshift.io/bindable" : "false"
2015-06-01 18:43:32 +02:00
}
} ,
"labels" : {
2017-11-09 17:06:49 +01:00
"template" : "django-example" ,
"app" : "django-example"
2015-06-01 18:43:32 +02:00
} ,
2018-07-24 17:39:33 +02:00
"message" : "The following service(s) have been created in your project: ${NAME}.\n\nFor more information about using this template, including OpenShift considerations, see https://github.com/sclorg/django-ex/blob/master/README.md." ,
2015-06-01 18:43:32 +02:00
"objects" : [
2017-01-18 18:13:16 +01:00
{
"kind" : "Secret" ,
"apiVersion" : "v1" ,
"metadata" : {
"name" : "${NAME}"
} ,
"stringData" : {
"django-secret-key" : "${DJANGO_SECRET_KEY}"
}
} ,
2015-06-01 18:43:32 +02:00
{
"kind" : "Service" ,
2015-06-11 17:19:47 +02:00
"apiVersion" : "v1" ,
2015-06-01 18:43:32 +02:00
"metadata" : {
2016-03-10 22:59:16 +01:00
"name" : "${NAME}" ,
2015-06-01 18:43:32 +02:00
"annotations" : {
2015-06-11 21:05:29 +02:00
"description" : "Exposes and load balances the application pods"
2015-06-01 18:43:32 +02:00
}
} ,
"spec" : {
"ports" : [
{
"name" : "web" ,
"port" : 8080 ,
"targetPort" : 8080
}
] ,
"selector" : {
2016-03-10 22:59:16 +01:00
"name" : "${NAME}"
2015-06-01 18:43:32 +02:00
}
}
} ,
2015-06-08 21:31:12 +02:00
{
"kind" : "Route" ,
2015-06-11 17:19:47 +02:00
"apiVersion" : "v1" ,
2015-06-08 21:31:12 +02:00
"metadata" : {
2017-11-07 20:03:41 +01:00
"name" : "${NAME}"
2015-06-08 21:31:12 +02:00
} ,
"spec" : {
2015-06-16 18:45:38 +02:00
"host" : "${APPLICATION_DOMAIN}" ,
2015-06-11 21:05:29 +02:00
"to" : {
"kind" : "Service" ,
2016-03-10 22:59:16 +01:00
"name" : "${NAME}"
2015-06-11 21:05:29 +02:00
}
}
} ,
{
"kind" : "ImageStream" ,
"apiVersion" : "v1" ,
"metadata" : {
2016-03-10 22:59:16 +01:00
"name" : "${NAME}" ,
2015-06-11 21:05:29 +02:00
"annotations" : {
"description" : "Keeps track of changes in the application image"
}
2015-06-08 21:31:12 +02:00
}
2015-06-11 17:19:47 +02:00
} ,
2015-06-01 18:43:32 +02:00
{
"kind" : "BuildConfig" ,
2015-06-11 17:19:47 +02:00
"apiVersion" : "v1" ,
2015-06-01 18:43:32 +02:00
"metadata" : {
2016-03-10 22:59:16 +01:00
"name" : "${NAME}" ,
2015-06-01 18:43:32 +02:00
"annotations" : {
2017-08-11 18:38:32 +02:00
"description" : "Defines how to build the application" ,
"template.alpha.openshift.io/wait-for-ready" : "true"
2015-06-01 18:43:32 +02:00
}
} ,
"spec" : {
"source" : {
"type" : "Git" ,
"git" : {
2015-06-16 12:07:49 +02:00
"uri" : "${SOURCE_REPOSITORY_URL}" ,
"ref" : "${SOURCE_REPOSITORY_REF}"
2015-06-01 18:43:32 +02:00
} ,
"contextDir" : "${CONTEXT_DIR}"
} ,
"strategy" : {
"type" : "Source" ,
"sourceStrategy" : {
"from" : {
2015-06-11 21:05:29 +02:00
"kind" : "ImageStreamTag" ,
2016-03-14 22:23:01 +01:00
"namespace" : "${NAMESPACE}" ,
2017-12-22 11:05:59 +01:00
"name" : "python:${PYTHON_VERSION}"
2016-07-06 17:51:46 +02:00
} ,
"env" : [
{
"name" : "PIP_INDEX_URL" ,
"value" : "${PIP_INDEX_URL}"
}
]
2015-06-01 18:43:32 +02:00
}
} ,
"output" : {
"to" : {
2015-06-16 11:53:41 +02:00
"kind" : "ImageStreamTag" ,
2016-03-10 22:59:16 +01:00
"name" : "${NAME}:latest"
2015-06-01 18:43:32 +02:00
}
} ,
"triggers" : [
{
2015-06-11 17:19:47 +02:00
"type" : "ImageChange"
2015-06-01 18:43:32 +02:00
} ,
2015-11-21 00:26:32 +01:00
{
"type" : "ConfigChange"
} ,
2015-06-01 18:43:32 +02:00
{
2015-06-11 17:19:47 +02:00
"type" : "GitHub" ,
2015-06-01 18:43:32 +02:00
"github" : {
2015-06-11 21:05:29 +02:00
"secret" : "${GITHUB_WEBHOOK_SECRET}"
2015-06-01 18:43:32 +02:00
}
}
2016-02-22 18:46:48 +01:00
] ,
"postCommit" : {
"script" : "./manage.py test"
}
2015-06-01 18:43:32 +02:00
}
} ,
{
"kind" : "DeploymentConfig" ,
2015-06-11 17:19:47 +02:00
"apiVersion" : "v1" ,
2015-06-01 18:43:32 +02:00
"metadata" : {
2016-03-10 22:59:16 +01:00
"name" : "${NAME}" ,
2015-06-01 18:43:32 +02:00
"annotations" : {
2017-08-11 18:38:32 +02:00
"description" : "Defines how to deploy the application server" ,
"template.alpha.openshift.io/wait-for-ready" : "true"
2015-06-01 18:43:32 +02:00
}
} ,
"spec" : {
"strategy" : {
"type" : "Rolling"
} ,
"triggers" : [
{
"type" : "ImageChange" ,
"imageChangeParams" : {
"automatic" : true ,
"containerNames" : [
2015-06-11 21:05:29 +02:00
"django-example"
2015-06-01 18:43:32 +02:00
] ,
"from" : {
2015-06-11 21:05:29 +02:00
"kind" : "ImageStreamTag" ,
2016-03-10 22:59:16 +01:00
"name" : "${NAME}:latest"
2015-06-01 18:43:32 +02:00
}
}
} ,
{
"type" : "ConfigChange"
}
] ,
"replicas" : 1 ,
"selector" : {
2016-03-10 22:59:16 +01:00
"name" : "${NAME}"
2015-06-01 18:43:32 +02:00
} ,
"template" : {
"metadata" : {
2016-03-10 22:59:16 +01:00
"name" : "${NAME}" ,
2015-06-01 18:43:32 +02:00
"labels" : {
2016-03-10 22:59:16 +01:00
"name" : "${NAME}"
2015-06-01 18:43:32 +02:00
}
} ,
"spec" : {
"containers" : [
{
2015-06-11 21:05:29 +02:00
"name" : "django-example" ,
2016-05-13 18:02:03 +02:00
"image" : " " ,
2015-06-01 18:43:32 +02:00
"ports" : [
{
"containerPort" : 8080
}
] ,
2016-02-29 16:19:42 +01:00
"readinessProbe" : {
"timeoutSeconds" : 3 ,
"initialDelaySeconds" : 3 ,
"httpGet" : {
"path" : "/" ,
"port" : 8080
}
} ,
"livenessProbe" : {
"timeoutSeconds" : 3 ,
"initialDelaySeconds" : 30 ,
"httpGet" : {
"path" : "/" ,
"port" : 8080
}
} ,
2015-06-01 18:43:32 +02:00
"env" : [
{
"name" : "APP_CONFIG" ,
"value" : "${APP_CONFIG}"
} ,
{
"name" : "DJANGO_SECRET_KEY" ,
2017-01-18 18:13:16 +01:00
"valueFrom" : {
"secretKeyRef" : {
"name" : "${NAME}" ,
"key" : "django-secret-key"
}
}
2016-11-02 20:27:35 +01:00
}
2016-02-25 00:28:13 +01:00
] ,
"resources" : {
2016-11-02 20:27:35 +01:00
"limits" : {
"memory" : "${MEMORY_LIMIT}"
}
2016-02-25 00:28:13 +01:00
}
2015-06-01 18:43:32 +02:00
}
]
}
}
}
2015-06-01 19:17:48 +02:00
}
2015-06-01 18:43:32 +02:00
] ,
"parameters" : [
2016-03-10 22:59:16 +01:00
{
"name" : "NAME" ,
"displayName" : "Name" ,
"description" : "The name assigned to all of the frontend objects defined in this template." ,
"required" : true ,
"value" : "django-example"
} ,
2016-03-14 22:23:01 +01:00
{
"name" : "NAMESPACE" ,
"displayName" : "Namespace" ,
2016-07-06 17:51:46 +02:00
"required" : true ,
2016-03-14 22:23:01 +01:00
"description" : "The OpenShift Namespace where the ImageStream resides." ,
"value" : "openshift"
} ,
2017-12-22 11:05:59 +01:00
{
"name" : "PYTHON_VERSION" ,
"displayName" : "Version of Python Image" ,
"description" : "Version of Python image to be used (3.4, 3.5, 3.6 or latest)." ,
"value" : "3.6" ,
"required" : true
} ,
2016-02-25 00:28:13 +01:00
{
"name" : "MEMORY_LIMIT" ,
2016-03-07 17:12:12 +01:00
"displayName" : "Memory Limit" ,
2016-07-06 17:51:46 +02:00
"required" : true ,
2016-03-07 17:12:12 +01:00
"description" : "Maximum amount of memory the container can use." ,
2016-03-01 04:09:26 +01:00
"value" : "512Mi"
2016-02-25 00:28:13 +01:00
} ,
2015-06-01 18:43:32 +02:00
{
2015-06-11 21:05:29 +02:00
"name" : "SOURCE_REPOSITORY_URL" ,
2016-03-07 17:12:12 +01:00
"displayName" : "Git Repository URL" ,
2016-07-06 17:51:46 +02:00
"required" : true ,
2016-03-07 17:12:12 +01:00
"description" : "The URL of the repository with your application source code." ,
2018-07-24 17:39:33 +02:00
"value" : "https://github.com/sclorg/django-ex.git"
2015-06-01 18:43:32 +02:00
} ,
2015-06-16 12:07:49 +02:00
{
"name" : "SOURCE_REPOSITORY_REF" ,
2016-03-07 17:12:12 +01:00
"displayName" : "Git Reference" ,
"description" : "Set this to a branch name, tag or other ref of your repository if you are not using the default branch."
2015-06-16 12:07:49 +02:00
} ,
2015-06-01 18:43:32 +02:00
{
"name" : "CONTEXT_DIR" ,
2016-03-07 17:12:12 +01:00
"displayName" : "Context Directory" ,
"description" : "Set this to the relative path to your project if it is not in the root of your repository."
2015-06-01 18:43:32 +02:00
} ,
{
2015-06-16 18:45:38 +02:00
"name" : "APPLICATION_DOMAIN" ,
2016-03-07 17:12:12 +01:00
"displayName" : "Application Hostname" ,
2015-08-18 19:19:30 +02:00
"description" : "The exposed hostname that will route to the Django service, if left blank a value will be defaulted." ,
"value" : ""
2015-06-01 18:43:32 +02:00
} ,
{
2015-06-11 21:05:29 +02:00
"name" : "GITHUB_WEBHOOK_SECRET" ,
2016-03-07 17:12:12 +01:00
"displayName" : "GitHub Webhook Secret" ,
2017-06-26 05:05:35 +02:00
"description" : "Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted." ,
2015-06-11 21:05:29 +02:00
"generate" : "expression" ,
"from" : "[a-zA-Z0-9]{40}"
2015-06-01 18:43:32 +02:00
} ,
{
"name" : "APP_CONFIG" ,
2016-03-07 17:12:12 +01:00
"displayName" : "Application Configuration File Path" ,
"description" : "Relative path to Gunicorn configuration file (optional)."
2015-06-01 18:43:32 +02:00
} ,
{
"name" : "DJANGO_SECRET_KEY" ,
2016-03-07 17:12:12 +01:00
"displayName" : "Django Secret Key" ,
"description" : "Set this to a long random string." ,
2015-06-01 18:43:32 +02:00
"generate" : "expression" ,
"from" : "[\\w]{50}"
2016-07-06 17:51:46 +02:00
} ,
{
"name" : "PIP_INDEX_URL" ,
"displayName" : "Custom PyPi Index URL" ,
"description" : "The custom PyPi index URL" ,
"value" : ""
2015-06-01 18:43:32 +02:00
}
]
}