summaryrefslogtreecommitdiffstats
path: root/roles/openshift_examples/files/examples/quickstart-templates/django.json
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_examples/files/examples/quickstart-templates/django.json')
-rw-r--r--roles/openshift_examples/files/examples/quickstart-templates/django.json254
1 files changed, 254 insertions, 0 deletions
diff --git a/roles/openshift_examples/files/examples/quickstart-templates/django.json b/roles/openshift_examples/files/examples/quickstart-templates/django.json
new file mode 100644
index 000000000..74bbea163
--- /dev/null
+++ b/roles/openshift_examples/files/examples/quickstart-templates/django.json
@@ -0,0 +1,254 @@
+{
+ "kind": "Template",
+ "apiVersion": "v1",
+ "metadata": {
+ "name": "django-example",
+ "annotations": {
+ "description": "An example Django application with no database",
+ "tags": "instant-app,python,django",
+ "iconClass": "icon-python"
+ }
+ },
+ "labels": {
+ "template": "django-example"
+ },
+ "objects": [
+ {
+ "kind": "Service",
+ "apiVersion": "v1",
+ "metadata": {
+ "name": "django-frontend",
+ "annotations": {
+ "description": "Exposes and load balances the application pods"
+ }
+ },
+ "spec": {
+ "ports": [
+ {
+ "name": "web",
+ "port": 8080,
+ "targetPort": 8080
+ }
+ ],
+ "selector": {
+ "name": "django-frontend"
+ }
+ }
+ },
+ {
+ "kind": "Route",
+ "apiVersion": "v1",
+ "metadata": {
+ "name": "django-route"
+ },
+ "spec": {
+ "host": "${APPLICATION_DOMAIN}",
+ "to": {
+ "kind": "Service",
+ "name": "django-frontend"
+ }
+ }
+ },
+ {
+ "kind": "ImageStream",
+ "apiVersion": "v1",
+ "metadata": {
+ "name": "django-example",
+ "annotations": {
+ "description": "Keeps track of changes in the application image"
+ }
+ }
+ },
+ {
+ "kind": "BuildConfig",
+ "apiVersion": "v1",
+ "metadata": {
+ "name": "django-example",
+ "annotations": {
+ "description": "Defines how to build the application"
+ }
+ },
+ "spec": {
+ "source": {
+ "type": "Git",
+ "git": {
+ "uri": "${SOURCE_REPOSITORY_URL}",
+ "ref": "${SOURCE_REPOSITORY_REF}"
+ },
+ "contextDir": "${CONTEXT_DIR}"
+ },
+ "strategy": {
+ "type": "Source",
+ "sourceStrategy": {
+ "from": {
+ "kind": "ImageStreamTag",
+ "namespace": "openshift",
+ "name": "python:3.3"
+ }
+ }
+ },
+ "output": {
+ "to": {
+ "kind": "ImageStreamTag",
+ "name": "django-example:latest"
+ }
+ },
+ "triggers": [
+ {
+ "type": "ImageChange"
+ },
+ {
+ "type": "GitHub",
+ "github": {
+ "secret": "${GITHUB_WEBHOOK_SECRET}"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "kind": "DeploymentConfig",
+ "apiVersion": "v1",
+ "metadata": {
+ "name": "django-frontend",
+ "annotations": {
+ "description": "Defines how to deploy the application server"
+ }
+ },
+ "spec": {
+ "strategy": {
+ "type": "Rolling"
+ },
+ "triggers": [
+ {
+ "type": "ImageChange",
+ "imageChangeParams": {
+ "automatic": true,
+ "containerNames": [
+ "django-example"
+ ],
+ "from": {
+ "kind": "ImageStreamTag",
+ "name": "django-example:latest"
+ }
+ }
+ },
+ {
+ "type": "ConfigChange"
+ }
+ ],
+ "replicas": 1,
+ "selector": {
+ "name": "django-frontend"
+ },
+ "template": {
+ "metadata": {
+ "name": "django-frontend",
+ "labels": {
+ "name": "django-frontend"
+ }
+ },
+ "spec": {
+ "containers": [
+ {
+ "name": "django-example",
+ "image": "django-example",
+ "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}"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "parameters": [
+ {
+ "name": "SOURCE_REPOSITORY_URL",
+ "description": "The URL of the repository with your application source code",
+ "value": "https://github.com/openshift/django-ex.git"
+ },
+ {
+ "name": "SOURCE_REPOSITORY_REF",
+ "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch"
+ },
+ {
+ "name": "CONTEXT_DIR",
+ "description": "Set this to the relative path to your project if it is not in the root of your repository"
+ },
+ {
+ "name": "APPLICATION_DOMAIN",
+ "description": "The exposed hostname that will route to the Django service",
+ "value": "django-example.openshiftapps.com"
+ },
+ {
+ "name": "GITHUB_WEBHOOK_SECRET",
+ "description": "A secret string used to configure the GitHub webhook",
+ "generate": "expression",
+ "from": "[a-zA-Z0-9]{40}"
+ },
+ {
+ "name": "DATABASE_SERVICE_NAME",
+ "description": "Database service name"
+ },
+ {
+ "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": "APP_CONFIG",
+ "description": "Relative path to Gunicorn configuration file (optional)"
+ },
+ {
+ "name": "DJANGO_SECRET_KEY",
+ "description": "Set this to a long random string",
+ "generate": "expression",
+ "from": "[\\w]{50}"
+ }
+ ]
+}