{
    "kind": "Template",
    "apiVersion": "v1",
    "metadata": {
        "name": "hexboard",
        "creationTimestamp": null,
        "annotations": {
            "name": "hexboard",
            "description": "Hexboard Demo",
            "provider": "Red Hat Summit 2015 - JBoss Keynote demo team",
            "iconClass": "icon-nodejs",
            "tags": "instant-app,nodejs"
        }
    },
    "parameters": [
        {
            "description": "OpenShift OAuth token (REQUIRED)",
            "value": "Missing!",
            "name": "ACCESS_TOKEN"
        },
        {
            "description": "builder image",
            "value": "nodejs:latest",
            "name": "BUILDER_IMAGE"
        },
        {
            "description": "Number of winners",
            "value": "10",
            "name": "WINNER_COUNT"
        },
        {
            "description": "The total number of hexagons (containers) to display in the UI",
            "value": "micro",
            "name": "HEXBOARD_SIZE"
        },
        {
            "description": "Admin Secret",
            "from": "[a-zA-Z0-9]{8}",
            "generate": "expression",
            "name": "ADMIN_TOKEN"
        },
        {
            "description": "Generic webhook secret",
            "generate": "expression",
            "from": "[a-zA-Z0-9]{40}",
            "name": "GENERIC_WEBHOOK_SECRET"
        },
        {
            "description": "GitHub webhook secret",
            "generate": "expression",
            "from": "[a-zA-Z0-9]{40}",
            "name": "GITHUB_WEBHOOK_SECRET"
        }
    ],
    "objects": [
        {
            "kind": "ImageStream",
            "apiVersion": "v1",
            "metadata": {
                "name": "sketchpod",
                "labels": {
                    "servicegroup": "sketchpod"
                },
                "creationTimestamp": null
            },
            "spec": {},
            "status": {
                "dockerImageRepository": ""
            }
        },
        {
            "kind": "BuildConfig",
            "apiVersion": "v1",
            "metadata": {
                "name": "sketchpod",
                "labels": {
                    "servicegroup": "sketchpod"
                },
                "creationTimestamp": null
            },
            "spec": {
                "triggers": [
                    {
                        "type": "GitHub",
                        "github": {
                            "secret": "${GITHUB_WEBHOOK_SECRET}"
                        }
                    },
                    {
                        "type": "Generic",
                        "generic": {
                            "secret": "${GENERIC_WEBHOOK_SECRET}"
                        }
                    },
                    {
                        "type": "ImageChange",
                        "imageChange": {}
                    }
                ],
                "source": {
                    "type": "Git",
                    "git": {
                        "uri": "http://github.com/2015-Middleware-Keynote/sketchpod"
                    }
                },
                "strategy": {
                    "type": "Source",
                    "sourceStrategy": {
                        "from": {
                            "kind": "ImageStreamTag",
                            "namespace": "openshift",
                            "name": "${BUILDER_IMAGE}"
                        }
                    }
                },
                "output": {
                    "to": {
                        "kind": "ImageStreamTag",
                        "name": "sketchpod:latest"
                    }
                },
                "resources": {}
            },
            "status": {
                "lastVersion": 0
            }
        },
        {
            "kind": "DeploymentConfig",
            "apiVersion": "v1",
            "metadata": {
                "name": "sketchpod",
                "labels": {
                    "servicegroup": "sketchpod"
                },
                "creationTimestamp": null
            },
            "spec": {
                "strategy": {
                    "type": "Recreate",
                    "resources": {}
                },
                "triggers": [
                    {
                        "type": "ConfigChange"
                    },
                    {
                        "type": "ImageChange",
                        "imageChangeParams": {
                            "automatic": true,
                            "containerNames": [
                                "sketchpod"
                            ],
                            "from": {
                                "kind": "ImageStreamTag",
                                "name": "sketchpod:latest"
                            }
                        }
                    }
                ],
                "replicas": 1,
                "selector": {
                    "deploymentconfig": "sketchpod"
                },
                "template": {
                    "metadata": {
                        "creationTimestamp": null,
                        "labels": {
                            "deploymentconfig": "sketchpod"
                        }
                    },
                    "spec": {
                        "containers": [
                            {
                                "name": "sketchpod",
                                "image": "sketchpod:latest",
                                "livenessProbe": {
                                    "httpGet": {
                                        "path": "/status",
                                        "port": 8080
                                    },
                                    "timeoutSeconds": 5,
                                    "initialDelaySeconds": 30
                                },
                                "ports": [
                                    {
                                        "name": "sketchpodtcp",
                                        "containerPort": 8080,
                                        "protocol": "TCP"
                                    }
                                ],
                                "resources": {},
                                "terminationMessagePath": "/dev/termination-log",
                                "imagePullPolicy": "Always",
                                "securityContext": {
                                    "capabilities": {},
                                    "privileged": false
                                }
                            }
                        ],
                        "restartPolicy": "Always",
                        "dnsPolicy": "ClusterFirst"
                    }
                }
            },
            "status": {}
        },
        {
            "kind": "Service",
            "apiVersion": "v1",
            "metadata": {
                "name": "sketchpod",
                "labels": {
                    "servicegroup": "sketchpod"
                },
                "creationTimestamp": null
            },
            "spec": {
                "ports": [
                    {
                        "name": "sketchpodtcp",
                        "protocol": "TCP",
                        "port": 8080,
                        "targetPort": 8080,
                        "nodePort": 0
                    }
                ],
                "selector": {
                    "deploymentconfig": "sketchpod"
                },
                "portalIP": "",
                "type": "ClusterIP"
            }
        },
        {
            "kind": "ImageStream",
            "apiVersion": "v1",
            "metadata": {
                "name": "hexboard",
                "creationTimestamp": null
            },
            "spec": {},
            "status": {
                "dockerImageRepository": ""
            }
        },
        {
            "kind": "BuildConfig",
            "apiVersion": "v1",
            "metadata": {
                "name": "hexboard",
                "creationTimestamp": null
            },
            "spec": {
                "triggers": [
                    {
                        "type": "GitHub",
                        "github": {
                            "secret": "${GITHUB_WEBHOOK_SECRET}"
                        }
                    },
                    {
                        "type": "Generic",
                        "generic": {
                            "secret": "${GENERIC_WEBHOOK_SECRET}"
                        }
                    },
                    {
                        "type": "ImageChange",
                        "imageChange": {}
                    }
                ],
                "source": {
                    "type": "Git",
                    "git": {
                        "uri": "http://github.com/ryanj/hexboard",
                        "ref": "master"
                    }
                },
                "strategy": {
                    "type": "Source",
                    "sourceStrategy": {
                        "from": {
                            "kind": "ImageStreamTag",
                            "namespace": "openshift",
                            "name": "${BUILDER_IMAGE}"
                        }
                    }
                },
                "output": {
                    "to": {
                        "kind": "ImageStreamTag",
                        "name": "hexboard:latest"
                    }
                },
                "resources": {}
            },
            "status": {
                "lastVersion": 0
            }
        },
        {
            "kind": "DeploymentConfig",
            "apiVersion": "v1",
            "metadata": {
                "name": "hexboard",
                "creationTimestamp": null
            },
            "spec": {
                "strategy": {
                    "type": "Recreate",
                    "resources": {}
                },
                "triggers": [
                    {
                        "type": "ConfigChange"
                    },
                    {
                        "type": "ImageChange",
                        "imageChangeParams": {
                            "automatic": true,
                            "containerNames": [
                                "hexboard"
                            ],
                            "from": {
                                "kind": "ImageStreamTag",
                                "name": "hexboard:latest"
                            }
                        }
                    }
                ],
                "replicas": 1,
                "selector": {
                    "deploymentconfig": "hexboard"
                },
                "template": {
                    "metadata": {
                        "creationTimestamp": null,
                        "labels": {
                            "deploymentconfig": "hexboard"
                        }
                    },
                    "spec": {
                        "containers": [
                            {
                                "name": "hexboard",
                                "image": "hexboard:latest",
                                "livenessProbe": {
                                    "httpGet": {
                                        "path": "/status",
                                        "port": 8080
                                    },
                                    "timeoutSeconds": 5,
                                    "initialDelaySeconds": 30
                                },
                                "env": [
                                    {
                                        "name": "HEXBOARD_SIZE",
                                        "value": "${HEXBOARD_SIZE}"
                                    },
                                    {
                                        "name": "WINNER_COUNT",
                                        "value": "${WINNER_COUNT}"
                                    },
                                    {
                                        "name": "ADMIN_TOKEN",
                                        "value": "${ADMIN_TOKEN}"
                                    },
                                    {
                                        "name": "ACCESS_TOKEN",
                                        "value": "${ACCESS_TOKEN}"
                                    }
                                ],
                                "ports": [
                                    {
                                        "name": "hexboardtcp",
                                        "containerPort": 8080,
                                        "protocol": "TCP"
                                    }
                                ],
                                "resources": {},
                                "terminationMessagePath": "/dev/termination-log",
                                "imagePullPolicy": "Always",
                                "securityContext": {
                                    "capabilities": {},
                                    "privileged": false
                                }
                            }
                        ],
                        "restartPolicy": "Always",
                        "dnsPolicy": "ClusterFirst"
                    }
                }
            },
            "status": {}
        },
        {
            "kind": "Service",
            "apiVersion": "v1",
            "metadata": {
                "name": "hexboard",
                "creationTimestamp": null
            },
            "spec": {
                "ports": [
                    {
                        "name": "hexboardtcp",
                        "protocol": "TCP",
                        "port": 8080,
                        "targetPort": 8080,
                        "nodePort": 0
                    }
                ],
                "selector": {
                    "deploymentconfig": "hexboard"
                },
                "portalIP": "",
                "type": "ClusterIP"
            }
        },
        {
            "kind": "Route",
            "apiVersion": "v1",
            "metadata": {
                "name": "hexboard",
                "creationTimestamp": null
            },
            "spec": {
                "host": "",
                "to": {
                    "kind": "Service",
                    "name": "hexboard"
                }
            },
            "status": {}
        }
    ]
}