2015-06-01 18:43:32 +02:00
|
|
|
{
|
|
|
|
"kind": "Template",
|
2015-06-03 16:34:49 +02:00
|
|
|
"apiVersion": "v1beta3",
|
2015-06-01 18:43:32 +02:00
|
|
|
"metadata": {
|
|
|
|
"name": "django-quickstart-source",
|
|
|
|
"annotations": {
|
|
|
|
"description": "Django application template that uses the Source build strategy.",
|
|
|
|
"tags": "instant-app,python,django",
|
|
|
|
"iconClass" : "icon-python"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"labels": {
|
|
|
|
"template": "django-quickstart-source"
|
|
|
|
},
|
|
|
|
"objects": [
|
|
|
|
{
|
|
|
|
"kind": "Service",
|
2015-06-03 16:34:49 +02:00
|
|
|
"apiVersion": "v1beta3",
|
2015-06-01 18:43:32 +02:00
|
|
|
"metadata": {
|
|
|
|
"name": "${FRONTEND_SERVICE_NAME}",
|
|
|
|
"annotations": {
|
|
|
|
"description": "Exposes and load balances the Django app instances."
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"name": "web",
|
|
|
|
"port": 8080,
|
|
|
|
"targetPort": 8080
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"selector": {
|
|
|
|
"name": "${FRONTEND_SERVICE_NAME}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2015-06-08 21:31:12 +02:00
|
|
|
{
|
|
|
|
"kind": "Route",
|
|
|
|
"apiVersion": "v1beta3",
|
|
|
|
"metadata": {
|
|
|
|
"name": "${FRONTEND_SERVICE_NAME}-route",
|
|
|
|
"creationTimestamp": null
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"host" : "${FRONTEND_ROUTE}",
|
|
|
|
"to": {
|
|
|
|
"kind" : "Service",
|
|
|
|
"name" : "${FRONTEND_SERVICE_NAME}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2015-06-01 18:43:32 +02:00
|
|
|
{
|
|
|
|
"kind": "BuildConfig",
|
2015-06-03 16:34:49 +02:00
|
|
|
"apiVersion": "v1beta3",
|
2015-06-01 18:43:32 +02:00
|
|
|
"metadata": {
|
2015-06-02 14:10:57 +02:00
|
|
|
"name": "django-quickstart-source",
|
2015-06-01 18:43:32 +02:00
|
|
|
"annotations": {
|
|
|
|
"description": "Defines how to build the Django app."
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"source": {
|
|
|
|
"type": "Git",
|
|
|
|
"git": {
|
|
|
|
"uri": "${GIT_REPOSITORY}"
|
|
|
|
},
|
|
|
|
"contextDir": "${CONTEXT_DIR}"
|
|
|
|
},
|
|
|
|
"strategy": {
|
|
|
|
"type": "Source",
|
|
|
|
"sourceStrategy": {
|
|
|
|
"from": {
|
|
|
|
"kind": "ImageStream",
|
|
|
|
"name": "${BUILDER_IMAGE_STREAM}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"output": {
|
|
|
|
"to": {
|
|
|
|
"kind": "ImageStream",
|
|
|
|
"name": "django-quickstart-source"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"triggers": [
|
|
|
|
{
|
2015-06-03 16:34:49 +02:00
|
|
|
"type": "imageChange",
|
|
|
|
"imageChange": {}
|
2015-06-01 18:43:32 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "github",
|
|
|
|
"github": {
|
|
|
|
"secret": "secret123"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "generic",
|
|
|
|
"generic": {
|
|
|
|
"secret": "secret123"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"kind": "DeploymentConfig",
|
2015-06-03 16:34:49 +02:00
|
|
|
"apiVersion": "v1beta3",
|
2015-06-01 18:43:32 +02:00
|
|
|
"metadata": {
|
|
|
|
"name": "${FRONTEND_SERVICE_NAME}",
|
|
|
|
"annotations": {
|
|
|
|
"description": "Defines how to deploy the Django app."
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"strategy": {
|
|
|
|
"type": "Rolling"
|
|
|
|
},
|
|
|
|
"triggers": [
|
|
|
|
{
|
|
|
|
"type": "ImageChange",
|
|
|
|
"imageChangeParams": {
|
|
|
|
"automatic": true,
|
|
|
|
"containerNames": [
|
|
|
|
"django-quickstart"
|
|
|
|
],
|
|
|
|
"from": {
|
2015-06-02 14:10:57 +02:00
|
|
|
"name": "django-quickstart-source:latest"
|
2015-06-01 18:43:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "ConfigChange"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"replicas": 1,
|
|
|
|
"selector": {
|
|
|
|
"name": "${FRONTEND_SERVICE_NAME}"
|
|
|
|
},
|
|
|
|
"template": {
|
|
|
|
"metadata": {
|
|
|
|
"name": "${FRONTEND_SERVICE_NAME}",
|
|
|
|
"labels": {
|
|
|
|
"name": "${FRONTEND_SERVICE_NAME}"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"containers": [
|
|
|
|
{
|
|
|
|
"name": "django-quickstart",
|
|
|
|
"image": "django-quickstart-source",
|
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"containerPort": 8080
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"env": [
|
|
|
|
{
|
|
|
|
"name": "DATABASE_SERVICE_NAME",
|
|
|
|
"value": "${DATABASE_SERVICE_NAME}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_ENGINE",
|
|
|
|
"value": "${DATABASE_ENGINE}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_NAME",
|
|
|
|
"value": "${DATABASE_NAME}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_USER",
|
|
|
|
"value": "${DATABASE_USER}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_PASSWORD",
|
|
|
|
"value": "${DATABASE_PASSWORD}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "APP_CONFIG",
|
|
|
|
"value": "${APP_CONFIG}"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DJANGO_SECRET_KEY",
|
|
|
|
"value": "${DJANGO_SECRET_KEY}"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"kind": "ImageStream",
|
2015-06-03 16:34:49 +02:00
|
|
|
"apiVersion": "v1beta3",
|
2015-06-01 18:43:32 +02:00
|
|
|
"metadata": {
|
|
|
|
"name": "django-quickstart-source",
|
|
|
|
"annotations": {
|
|
|
|
"description": "Keeps track of changes in the Django app image."
|
|
|
|
}
|
|
|
|
}
|
2015-06-01 19:17:48 +02:00
|
|
|
}
|
2015-06-01 18:43:32 +02:00
|
|
|
],
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "GIT_REPOSITORY",
|
|
|
|
"description": "Change this to match your project's Git repository",
|
|
|
|
"value": "git://github.com/openshift/django-ex.git"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "CONTEXT_DIR",
|
|
|
|
"description": "Set this to the relative path to your project if it is not in the root of your repository"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "FRONTEND_SERVICE_NAME",
|
|
|
|
"description": "Frontend service name",
|
|
|
|
"value": "django"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_SERVICE_NAME",
|
|
|
|
"description": "Database service name"
|
|
|
|
},
|
2015-06-08 21:31:12 +02:00
|
|
|
{
|
|
|
|
"name": "FRONTEND_ROUTE",
|
|
|
|
"description": "The exposed hostname that will route to the frontend service",
|
|
|
|
"value": "django-frontend.apps"
|
|
|
|
},
|
2015-06-01 18:43:32 +02:00
|
|
|
{
|
|
|
|
"name": "DATABASE_ENGINE",
|
|
|
|
"description": "Database engine: postgresql, mysql or sqlite (default)"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_NAME",
|
|
|
|
"description": "Database name"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_USER",
|
|
|
|
"description": "Database user name"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_PASSWORD",
|
|
|
|
"description": "Database user password"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "BUILDER_IMAGE_STREAM",
|
|
|
|
"description": "Image Stream of the builder image",
|
|
|
|
"value": "python-33-centos7"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "APP_CONFIG",
|
2015-06-04 16:47:06 +02:00
|
|
|
"description": "Relative path to Gunicorn configuration file (optional)"
|
2015-06-01 18:43:32 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DJANGO_SECRET_KEY",
|
2015-06-04 16:47:06 +02:00
|
|
|
"description": "Set this to a long random string",
|
2015-06-01 18:43:32 +02:00
|
|
|
"generate": "expression",
|
|
|
|
"from": "[\\w]{50}"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|