# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: OceanBase
spec:
    description: An enterprise distributed relational database with high availability, high performance, horizontal scalability, and compatibility with SQL standards.
    coverImage: https://mdn.alipayobjects.com/huamei_fhnyvh/afts/img/A*qI5lT4lL1PEAAAAAAAAAAAAAemfOAQ/original
    icon: https://avatars.githubusercontent.com/u/82347605
    tags:
        - Database
    readme: |
        An enterprise distributed relational database with high availability, high performance, horizontal scalability, and compatibility with SQL standards.

        ## Environment Variables

        When you deploy the OceanBase service, Zeabur will automatically inject the relevant environment variables into other services.

        - `OB_HOST`: The hostname of the OceanBase service.
        - `OB_PORT`: The port of the OceanBase service.
        - `OB_TENANT`: The tenant of the OceanBase service.
        - `OB_USERNAME`: The username for the OceanBase service.
        - `OB_PASSWORD`: The password for the OceanBase service.
        - `OB_URI` or `OB_CONNECTION_STRING`: The connection string for the OceanBase service.
    services:
        - name: oceanbase
          icon: https://avatars.githubusercontent.com/u/82347605
          template: PREBUILT
          spec:
            source:
                image: oceanbase/oceanbase-ce:4.3.5.0-100000202024123117
            ports:
                - id: database
                  port: 2881
                  type: TCP
            volumes:
                - id: data
                  dir: /data/1
                - id: log
                  dir: /data/log1
            instructions:
                - title: Command to connect to your OceanBase
                  content: mysql -h${PORT_FORWARDED_HOSTNAME} -P${DATABASE_PORT_FORWARDED_PORT} -u${OB_USERNAME}@${OB_TENANT} -p${OB_PASSWORD}
                - title: OceanBase host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: OceanBase port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
                - title: OceanBase tenant
                  content: ${OB_TENANT}
                - title: OceanBase username
                  content: ${OB_USERNAME}
                - title: OceanBase password
                  content: ${OB_PASSWORD}
            env:
                OB_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                OB_PASSWORD:
                    default: ${OB_TENANT_PASSWORD}
                    expose: true
                OB_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                OB_SYS_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                OB_TENANT:
                    default: ${OB_TENANT_NAME}
                    expose: true
                OB_TENANT_NAME:
                    default: test
                    expose: true
                OB_TENANT_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                OB_USERNAME:
                    default: root
                    expose: true
localization:
    zh-CN:
        description: 为现代数据架构打造的分布式数据库。
        readme: |
            为现代数据架构打造的分布式数据库。

            ## 环境变量

            当您部署 OceanBase 服务时，Zeabur 会自动将相关的环境变量注入到其他服务中。

            - `OB_HOST`：OceanBase 服务的主机名。
            - `OB_PORT`：OceanBase 服务的端口。
            - `OB_TENANT`：OceanBase 服务的租户。
            - `OB_USERNAME`：OceanBase 服务的用户名。
            - `OB_PASSWORD`：OceanBase 服务的密码。
            - `OB_URI` 或 `OB_CONNECTION_STRING`：OceanBase 服务的连接字符串。
    zh-TW:
        description: 為現代數據架構打造的分散式資料庫。
        readme: |-
            為現代數據架構打造的分散式資料庫。

            ## 環境變數

            當您部署 OceanBase 服務時，Zeabur 會自動將相關的環境變數注入到其他服務中。

            - `OB_HOST`：OceanBase 服務的主機名稱。
            - `OB_PORT`：OceanBase 服務的連接埠。
            - `OB_TENANT`：OceanBase 服務的租戶。
            - `OB_USERNAME`：OceanBase 服務的使用者名稱。
            - `OB_PASSWORD`：OceanBase 服務的密碼。
            - `OB_URI` 或 `OB_CONNECTION_STRING`：OceanBase 服務的連線字串。
