{
  "kind": "Template",
  "apiVersion": "v1",
  "metadata": {
    "name": "${NAME}-build-template",
    "creationTimestamp": null
  },
  "objects": [
    {
      "apiVersion": "v1",
      "kind": "ImageStream",
      "metadata": {
        "name": "${NAME}"
      }
    },
    {
      "kind": "BuildConfig",
      "apiVersion": "v1",
      "metadata": {
        "name": "${NAME}",
        "labels": {
          "app": "${NAME}"
        }
      },
      "spec": {
        "triggers": [
          {
            "type": "ConfigChange"
          }
        ],
        "runPolicy": "Serial",
        "source": {
          "type": "Git",
          "git": {
            "uri": "${GIT_REPO_URL}",
            "ref": "${GIT_REF}"
          },
          "contextDir": "${SOURCE_CONTEXT_DIR}"
        },
        "strategy": {
          "type": "Docker"
        },
        "output": {
          "to": {
            "kind": "ImageStreamTag",
            "name": "${NAME}:${OUTPUT_IMAGE_TAG}"
          }
        }
      }
    }
  ],
  "parameters": [
    {
      "name": "NAME",
      "displayName": "Name",
      "description": "The name assigned to all of the resources defined in this template.",
      "required": true,
      "value": "s2i-nginx"
    },
    {
      "name": "GIT_REPO_URL",
      "displayName": "Git Repo URL",
      "description": "The URL to your GIT repo, don't use the default unless your just experimenting.",
      "required": true,
      "value": "https://github.com/BCDevOps/s2i-nginx.git"
    },
    {
      "name": "GIT_REF",
      "displayName": "Git Reference",
      "description": "The git reference or branch.",
      "required": true,
      "value": "master"
    },
    {
      "name": "SOURCE_CONTEXT_DIR",
      "displayName": "Source Context Directory",
      "description": "The source context directory.",
      "required": false,
      "value": ""
    },
    {
      "name": "OUTPUT_IMAGE_TAG",
      "displayName": "Output Image Tag",
      "description": "The tag given to the built image.",
      "required": true,
      "value": "latest"
    }
  ]
}