labels:
  io.cattle.role: cluster # options are cluster/project
categories:
- CI/CD
questions:
- variable: defaultImage
  default: true
  description: "Use default Docker image"
  label: Use Default Image
  type: boolean
  show_subquestion_if: false
  group: "Container Images"
  subquestions:
  - variable: images.server.repository
    default: "ranchercharts/drone-drone"
    description: "Drone Server image name"
    type: string
    label: Drone Server Image Name
  - variable: images.server.tag
    default: "1.2"
    description: "Drone Server image tag"
    type: string
    label: Drone Server Image Tag
  - variable: images.agent.repository
    default: "ranchercharts/drone-agent"
    description: "Drone Agent image name"
    type: string
    label: Drone Agent Image Name
  - variable: images.agent.tag
    default: "1.2"
    description: "Drone Agent image tag"
    type: string
    label: Drone Agent Image Tag
  - variable: images.dind.repository
    default: "ranchercharts/library-docker"
    description: "Drone Dind image name"
    type: string
    label: Drone Dind Image Name
  - variable: images.dind.tag
    default: "18.06.1-ce-dind"
    description: "Drone Dind image tag"
    type: string
    label: Drone Dind Image Tag
- variable: server.host
  default: ""
  type: string
  description: "Set drone server host e.g drone.domain.io, if not set, it will be autofilled with the cluster host."
  label: Drone Host Domain
  required: true
  group: "Drone Settings"
- variable: server.adminUser
  default: ""
  type: string
  description: "Set to a valid oauth user from your git/oauth server."
  label: Set Drone Admin User
  group: "Drone Settings"
- variable: sourceControl.provider
  default: "github"
  description: "Choose your server integrations"
  type: enum
  required: true
  label: Drone Integration Server
  group: "Drone Settings"
  options:
  - "github"
  - "gitlab"
  - "gitea"
  - "gogs"
  - "bitbucketCloud"
  - "bitbucketServer"
- variable: sourceControl.secret
  default: ""
  type: secret
  description: "Name of an existing secret to get the drone provider secret values from."
  label: Select the Existing Drone Provider Secret
  group: "Drone Settings"
# Github config
- variable: sourceControl.github.clientID
  default: ""
  description: "Github oauth client ID"
  type: string
  required: true
  label: Github OAuth Client ID
  show_if: "sourceControl.provider=github"
  group: "Drone Settings"
- variable: sourceControl.github.clientSecretValue
  default: ""
  description: "Github oauth client secret"
  type: string
  required: true
  show_if: "sourceControl.provider=github&&sourceControl.secret="
  group: "Drone Settings"
  label: Github OAuth Client Secret
# Gitlab config
- variable: sourceControl.gitlab.clientID
  default: ""
  description: "GitLab oauth2 client id"
  type: string
  required: true
  label: GitLab OAuth2 Client ID
  show_if: "sourceControl.provider=gitlab"
  group: "Drone Settings"
- variable: sourceControl.gitlab.server
  default: ""
  description: "GitLab Server Address"
  type: string
  required: true
  label: GitLab Server Address
  show_if: "sourceControl.provider=gitlab"
  group: "Drone Settings"
- variable: sourceControl.gitlab.clientSecretValue
  default: ""
  description: "GitLab client secret"
  type: string
  required: true
  label: GitLab Client Secret
  show_if: "sourceControl.provider=gitlab&&sourceControl.secret="
  group: "Drone Settings"
# Gitea config
- variable: sourceControl.gitea.server
  default: ""
  description: "Gitea Server Address"
  type: string
  required: true
  label: Gitea Server Address
  show_if: "sourceControl.provider=gitea"
  group: "Drone Settings"
# Gogs config
- variable: sourceControl.gogs.server
  default: ""
  description: "Gogs Server Address"
  type: string
  required: true
  label: Gogs Server Address
  show_if: "sourceControl.provider=gogs"
  group: "Drone Settings"
# BitbucketCloud config
- variable: sourceControl.bitbucketCloud.clientID
  default: ""
  description: "Bitbucket cloud oauth2 client id"
  type: string
  required: true
  label: Bitbucket Cloud OAuth2 Client ID
  show_if: "sourceControl.provider=bitbucketCloud"
  group: "Drone Settings"
- variable: sourceControl.bitbucketCloud.clientSecretValue
  default: ""
  description: "Bitbucket cloud client secret"
  type: string
  required: true
  label: Bitbucket Cloud Client Secret
  show_if: "sourceControl.provider=bitbucketCloud&&sourceControl.secret="
  group: "Drone Settings"
# BitbucketServer config
- variable: sourceControl.bitbucketServer.server
  default: ""
  description: "Bitbucket Server Address"
  type: string
  required: true
  label: Bitbucket Server Address
  show_if: "sourceControl.provider=bitbucketServer"
  group: "Drone Settings"
- variable: sourceControl.bitbucketServer.username
  default: ""
  description: "Bitbucket server username"
  type: string
  required: true
  label: Bitbucket Server Username
  show_if: "sourceControl.provider=bitbucketCloud"
  group: "Drone Settings"
# persistent setting
- variable: persistence.enabled
  default: false
  description: "Enable persistent volume for Drone Application"
  type: boolean
  required: true
  label: Drone Persistent Volume Enabled
  show_subquestion_if: true
  group: "Drone Settings"
  subquestions:
  - variable: persistence.size
    default: "10Gi"
    description: "Drone Persistent Volume Size"
    type: string
    label: Drone Volume Size
  - variable: persistence.storageClass
    default: ""
    description: "If undefined or null, uses the default StorageClass. Default to null"
    type: storageclass
    label: Default StorageClass for Drone
  - variable: persistence.existingClaim
    default: ""
    description: "If not empty, uses the specified existing PVC instead of creating new one"
    type: pvc
    label: Uses Existing Persistent Volume Cliam
- variable: server.env.DRONE_LOGS_DEBUG
  default: "false"
  type: enum
  description: "The default log level is INFO. You can enable more detailed debug logging with the following configuration parameter."
  label: Enable Drone Server Debugging Logs
  group: "Drone Settings"
  options:
  - "false"
  - "true"
# database setting
- variable: server.env.DRONE_DATABASE_DRIVER
  default: "sqlite3"
  description: "Drone requires the use of a database backend for persistence. Drone uses an embedded sqlite database by default"
  type: enum
  required: true
  label: Select Drone Databse Driver
  group: "Database Settings"
  options:
  - "sqlite3"
  - "postgres"
  - "mysql"
- variable: server.env.DRONE_DATABASE_DATASOURCE
  default: ""
  description: "Specify Drone database datasource, e.g., postgres://root:password@1.2.3.4:5432/postgres?sslmode=disable"
  type: string
  required: true
  label: Drone Database Datasource
  show_if: "server.env.DRONE_DATABASE_DRIVER!=sqlite3"
  group: "Database Settings"
# service & LB settings
- variable: ingress.enabled
  default: false
  description: "Expose app using Layer 7 Load Balancer - ingress"
  type: boolean
  label: Expose app using Layer 7 Load Balancer
  show_subquestion_if: true
  group: "Services and Load Balancing"
  subquestions:
  - variable: ingress.hosts[0]
    default: "xip.io"
    description: "Hostname to your Drone application"
    type: hostname
    required: true
    label: Hostname
- variable: service.type
  default: "NodePort"
  description: "Drone Service type"
  type: enum
  show_if: "ingress.enabled=false"
  options:
    - "ClusterIP"
    - "NodePort"
  required: true
  label: Drone Service Type
  show_subquestion_if: "NodePort"
  group: "Services and Load Balancing"
  subquestions:
  - variable: service.nodePort
    default: ""
    description: "NodePort http port(to set explicitly, choose port between 30000-32767)"
    type: int
    min: 30000
    max: 32767
    show_if: "ingress.enabled=false&&service.type=NodePort"
    label: NodePort Http Port
- variable: metrics.prometheus.enabled
  default: false
  description: "Enable Prometheus metrics endpoint"
  type: boolean
  label: Enable Prometheus Metrics Endpoint
  group: "Metrics Setting"
