{%- if cookiecutter.template_type == 'build' %}
{
  "name": "{{cookiecutter.template_name}}",
  "description": "Build, test and verify your [{{cookiecutter.template_name}}]({{cookiecutter.refdoc_url}}) projects",
  "template_path": "templates/gitlab-ci-{{cookiecutter.project_slug}}.yml",
  "kind": "build",
  "variables": [
    {
      "name": "{{cookiecutter.template_PREFIX}}_IMAGE",
      "description": "The Docker image used to run `{{cookiecutter.cli_tool}}`",
      "default": "registry.hub.docker.com/{{cookiecutter.project_slug}}:1.2.3"
    },
    {
      "name": "{{cookiecutter.template_PREFIX}}_BUILD_ARGS",
      "description": "Arguments used by the build job",
      "default": "build --with-default-args",
      "advanced": true
    }
  ],
  "features": [
    {
      "id": "lint",
      "name": "{{cookiecutter.template_PREFIX}} lint",
      "description": "[{{cookiecutter.template_PREFIX}} lint](link-to-the-tool) analysis",
      "disable_with": "{{cookiecutter.template_PREFIX}}_LINT_DISABLED",
      "variables": [
        {
          "name": "{{cookiecutter.template_PREFIX}}_LINT_IMAGE",
          "description": "The Docker image used to run the lint tool",
          "default": "registry.hub.docker.com/{{cookiecutter.project_slug}}-lint:latest"
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_LINT_ARGS",
          "description": "Lint [options and arguments](link-to-the-cli-options)",
          "default": "--serevity=medium",
          "advanced": true
        }
      ]
    },
    {
      "id": "depcheck",
      "name": "{{cookiecutter.template_PREFIX}} dependency check",
      "description": "[{{cookiecutter.template_PREFIX}} dependency check](link-to-the-tool) analysis",
      "variables": [
        {
          "name": "{{cookiecutter.template_PREFIX}}_DEPCHECK_IMAGE",
          "description": "The Docker image used to run the dependency check tool",
          "default": "registry.hub.docker.com/{{cookiecutter.project_slug}}-depcheck:latest"
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_DEPCHECK_ARGS",
          "description": "Dependency check [options and arguments](link-to-the-cli-options)",
          "advanced": true
        }
      ]
    },
    {
      "id": "publish",
      "name": "Publish",
      "description": "Publish your package to a repository",
      "enable_with": "{{cookiecutter.template_PREFIX}}_PUBLISH_ENABLED",
      "variables": [
        {
          "name": "{{cookiecutter.template_PREFIX}}_PUBLISH_ARGS",
          "description": "Arguments used by the publish job",
          "default": "publish --with-default-args",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_PUBLISH_LOGIN",
          "description": "Login to use to publish",
          "secret": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_PUBLISH_PASSWORD",
          "description": "Password to use to publish",
          "secret": true
        }
      ]
    }
  ]
}
{%- elif cookiecutter.template_type == 'deploy' %}
{
  "name": "{{cookiecutter.template_name}}",
  "description": "Deploy your application to [{{cookiecutter.template_name}}]({{cookiecutter.refdoc_url}})",
  "template_path": "templates/gitlab-ci-{{cookiecutter.project_slug}}.yml",
  "kind": "hosting",
  "variables": [
    {
      "name": "{{cookiecutter.template_PREFIX}}_IMAGE",
      "description": "the Docker image used to run {{cookiecutter.template_name}} CLI commands - **set the version required by your {{cookiecutter.template_name}} cluster**",
      "default": "registry.hub.docker.com/{{cookiecutter.project_slug}}:latest"
    },
    {
      "name": "{{cookiecutter.template_PREFIX}}_API_URL",
      "type": "url",
      "description": "Default {{cookiecutter.template_name}} API url"
    },
    {
      "name": "{{cookiecutter.template_PREFIX}}_API_TOKEN",
      "description": "Default {{cookiecutter.template_name}} API token",
      "secret": true
    },
    {
      "name": "{{cookiecutter.template_PREFIX}}_BASE_APP_NAME",
      "description": "Base application name",
      "default": "$CI_PROJECT_NAME",
      "advanced": true
    },
    {
      "name": "{{cookiecutter.template_PREFIX}}_ENVIRONMENT_URL",
      "type": "url",
      "description": "The default environments url _(only define for static environment URLs declaration)_\n\n_supports late variable expansion (ex: `https://%{environment_name}.k8s.acme.com`)_"
    },
    {
      "name": "{{cookiecutter.template_PREFIX}}_SCRIPTS_DIR",
      "description": "Directory where deploy & cleanup scripts are located",
      "default": ".",
      "advanced": true
    }
  ],
  "features": [
    {
      "id": "review",
      "name": "Review",
      "description": "Dynamic review environments for your topic branches (see GitLab [Review Apps](https://docs.gitlab.com/ee/ci/review_apps/))",
      "variables": [
        {
          "name": "{{cookiecutter.template_PREFIX}}_REVIEW_PROJECT",
          "description": "Project ID for `review` env",
          "mandatory": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_REVIEW_APP_NAME",
          "description": "The application name for `review` env (only define if different from global)",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_REVIEW_AUTOSTOP_DURATION",
          "description": "The amount of time before GitLab will automatically stop `review` environments",
          "default": "4 hours"
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_REVIEW_ENVIRONMENT_URL",
          "type": "url",
          "description": "The `review` environments url _(only define for static environment URLs declaration and if different from default)_",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_REVIEW_API_URL",
          "type": "url",
          "description": "API url for `review` env _(only define if different from default)_",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_REVIEW_API_TOKEN",
          "description": "API token for `review` env (only define if different from default)",
          "secret": true
        }
      ]
    },
    {
      "id": "integration",
      "name": "Integration",
      "description": "A continuous-integration environment associated to your integration branch (`develop` by default)",
      "variables": [
        {
          "name": "{{cookiecutter.template_PREFIX}}_INTEG_PROJECT",
          "description": "Project ID for `integration` env",
          "mandatory": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_INTEG_APP_NAME",
          "description": "The application name for `integration` env (only define if different from global)",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_INTEG_ENVIRONMENT_URL",
          "type": "url",
          "description": "The `integration` environment url _(only define for static environment URLs declaration and if different from default)_",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_INTEG_API_URL",
          "type": "url",
          "description": "API url for `integration` env _(only define if different from default)_",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_INTEG_API_TOKEN",
          "description": "API token for `integration` env (only define if different from default)",
          "secret": true
        }
      ]
    },
    {
      "id": "staging",
      "name": "Staging",
      "description": "An iso-prod environment meant for testing and validation purpose on your production branch (`main` or `master` by default)",
      "variables": [
        {
          "name": "{{cookiecutter.template_PREFIX}}_STAGING_PROJECT",
          "description": "Project ID for `staging` env",
          "mandatory": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_STAGING_APP_NAME",
          "description": "The application name for `staging` env (only define if different from global)",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_STAGING_ENVIRONMENT_URL",
          "type": "url",
          "description": "The `staging` environment url _(only define for static environment URLs declaration and if different from default)_",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_STAGING_API_URL",
          "type": "url",
          "description": "API url for `staging` env _(only define if different from default)_",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_STAGING_API_TOKEN",
          "description": "API token for `staging` env (only define if different from default)",
          "secret": true
        }
      ]
    },
    {
      "id": "prod",
      "name": "Production",
      "description": "The production environment",
      "variables": [
        {
          "name": "{{cookiecutter.template_PREFIX}}_PROD_PROJECT",
          "description": "Project ID for `production` env",
          "mandatory": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_PROD_APP_NAME",
          "description": "The application name for `production` env (only define if different from global)",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_PROD_ENVIRONMENT_URL",
          "type": "url",
          "description": "The `production` environment url _(only define for static environment URLs declaration and if different from default)_",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_PROD_DEPLOY_STRATEGY",
          "description": "Defines the deployment to `production` strategy.",
          "type": "enum",
          "values": ["manual", "auto"],
          "default": "manual"
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_PROD_API_URL",
          "type": "url",
          "description": "API url for `production` env _(only define if different from default)_",
          "advanced": true
        },
        {
          "name": "{{cookiecutter.template_PREFIX}}_PROD_API_TOKEN",
          "description": "API token for `production` env (only define if different from default)",
          "secret": true
        }
      ]
    }
  ]
}
{%- elif cookiecutter.template_type == 'acceptance' %}
{
  "name": "{{cookiecutter.template_name}}",
  "description": "Run your automated tests with [{{cookiecutter.template_name}}]({{cookiecutter.refdoc_url}})",
  "template_path": "templates/gitlab-ci-{{cookiecutter.project_slug}}.yml",
  "kind": "acceptance",
  "variables": [
    {
      "name": "{{cookiecutter.template_PREFIX}}_IMAGE",
      "description": "The Docker image used to run {{cookiecutter.template_name}}",
      "default": "registry.hub.docker.com/{{cookiecutter.project_slug}}:latest"
    },
    {
      "name": "{{cookiecutter.template_PREFIX}}_PROJECT_DIR",
      "description": "The {{cookiecutter.template_name}} project directory (containing test scripts)",
      "default": "."
    },
    {
      "name": "{{cookiecutter.template_PREFIX}}_EXTRA_ARGS",
      "description": "{{cookiecutter.template_name}} extra [run options](link-to-cli-options-ref)",
      "advanced": true
    },
    {
      "name": "REVIEW_ENABLED",
      "description": "Set to enable {{cookiecutter.template_name}} tests on review environments (dynamic environments instantiated on development branches)",
      "type": "boolean"
    }
  ]
}
{%- endif %}