---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.4.1
  name: plays.ci.w6d.io
spec:
  group: ci.w6d.io
  names:
    kind: Play
    listKind: PlayList
    plural: plays
    singular: play
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .status.state
      name: State
      type: string
    - jsonPath: .status.pipeline_run_name
      name: PipelineRun
      priority: 1
      type: string
    - jsonPath: .status.message
      name: Message
      priority: 1
      type: string
    - description: CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.
      jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: Play is the Schema for the plays API
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: PlaySpec defines the desired state of Play
            properties:
              commit:
                description: Commit contains all git information
                properties:
                  before_sha:
                    description: BeforeSHA contains the commit before sha
                    type: string
                  message:
                    description: Message contains commit message
                    type: string
                  ref:
                    description: Ref contains git commit reference
                    type: string
                  sha:
                    description: SHA contains git commit SHA
                    type: string
                type: object
              docker_url:
                description: DockerURL contains the registry name and tag where to push docker image
                type: string
              domain:
                description: Domain contains the url for exposition
                type: string
              environment:
                description: Environment contains application environment
                type: string
              expose:
                description: Expose toggles the creation of the ingress in case of deployment
                type: boolean
              external:
                description: External toggles is for using in values templating
                type: boolean
              name:
                description: Name of project
                type: string
              pipeline_id:
                description: PipelineID contains the ID of pipeline for the project
                format: int64
                type: integer
              project_id:
                description: ProjectID contains the project ID
                format: int64
                type: integer
              repo_url:
                description: RepoURL contains the git repository url
                type: string
              scope:
                description: Scope contains the name of scope and list of projects id
                properties:
                  name:
                    description: Name of the scope
                    type: string
                  projects:
                    description: Projects is the list of project id in this scope
                    format: int64
                    type: integer
                type: object
              secret:
                additionalProperties:
                  type: string
                description: Secret contains the secret data. Each key must be either - git_token - .dockerconfigjson - sonar_token - kubeconfig
                type: object
              stack:
                description: Stack of the project
                properties:
                  language:
                    description: Language contains the repository language
                    type: string
                  package:
                    description: Package contains the package use in application
                    type: string
                type: object
              tasks:
                description: Tasks contains the list of task to be created by Play
                items:
                  additionalProperties:
                    description: Task is what actions and/or configuration the task can be contains
                    properties:
                      annotations:
                        additionalProperties:
                          type: string
                        description: Annotations is use for ingress annotations
                        type: object
                      arguments:
                        description: Arguments is used for flags in task
                        items:
                          type: string
                        type: array
                      docker:
                        description: Docker contains information for docker build
                        properties:
                          context:
                            description: Context contains the docker build context
                            type: string
                          filepath:
                            description: Filepath contains the dockerfile full path
                            type: string
                        type: object
                      image:
                        description: Image to use for this task
                        type: string
                      namespace:
                        description: Namespace where to deploy application. used only in deploy task
                        type: string
                      script:
                        description: Script is a list of command to execute in the task
                        items:
                          type: string
                        type: array
                      variables:
                        additionalProperties:
                          type: string
                        description: Variables is the map of environment variable for the task
                        type: object
                    type: object
                  type: object
                type: array
              vault:
                description: Vault contain a vault information to get secret from
                properties:
                  secrets:
                    additionalProperties:
                      description: VaultSecret contains information for get and put vault secret
                      properties:
                        path:
                          description: Path is where the secret is in vault
                          type: string
                        volumePath:
                          description: VolumePath is the folder where the secret will be put
                          type: string
                      type: object
                    description: Secrets is a map of the secret
                    type: object
                  token:
                    description: Token vault
                    type: string
                type: object
            type: object
          status:
            description: PlayStatus defines the observed state of Play
            properties:
              conditions:
                description: Conditions represents the latest available observations of play
                items:
                  description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions.  For example, type FooStatus struct{     // Represents the observations of a foo's current state.     // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\"     // +patchMergeKey=type     // +patchStrategy=merge     // +listType=map     // +listMapKey=type     Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n     // other fields }"
                  properties:
                    lastTransitionTime:
                      description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.
                      format: date-time
                      type: string
                    message:
                      description: message is a human readable message indicating details about the transition. This may be an empty string.
                      maxLength: 32768
                      type: string
                    observedGeneration:
                      description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
                      format: int64
                      minimum: 0
                      type: integer
                    reason:
                      description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
                      maxLength: 1024
                      minLength: 1
                      pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
                      type: string
                    status:
                      description: status of the condition, one of True, False, Unknown.
                      enum:
                      - "True"
                      - "False"
                      - Unknown
                      type: string
                    type:
                      description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
                      maxLength: 316
                      pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
                      type: string
                  required:
                  - lastTransitionTime
                  - message
                  - reason
                  - status
                  - type
                  type: object
                type: array
              message:
                description: Message contains the pipeline message
                type: string
              pipeline_run_name:
                description: PipelineRunName contains the pipeline run name created by play
                type: string
              state:
                description: State contains the current state of this Play resource. States Running, Failed, Succeeded, Errored
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []

