CircleCI Orb

Upload your updated schemas via CircleCI pipeline

The schema publisher orb can be used to upload new protobuf schema artifacts to one of your existing schemas

Example usage

In order to use the orb, you must first generate an API token from https://console.streamdal.com/account/security . Then addd the key as an environment variable named BATCH_API_KEY under your CircleCI project. You can then use the orb to upload a zip of .proto files or a file descriptor set

File Descriptor Set Upload

.circleci/config.yml:

version: 2.1
orbs:
  publisher: batchcorp/schema-publisher-orb@0.1.0

jobs:
  build:
    docker:
      - image: cimg/base:current
    steps:
      - checkout
      - persist_to_workspace:
          root: ~/project
          paths:
            - build/go/descriptor-sets
workflows:
  publish-protos:
    jobs:
      - build
      - publisher/publish:
          requires:
            - build
          pre-steps:
            - attach_workspace:
                at: /tmp/output
          schemaId: "7e8c3d9c-ed21-475e-832f-794abae3deac"
          schemaName: "CircleCI test"
          schemaType: "protobuf"
          artifactType: "descriptor_set"
          descriptorSetPath: "/tmp/output/build/go/descriptor-sets/protos.fds"

.protos directory upload

.circleci/config.yml:

version: 2.1
orbs:
  publisher: batchcorp/schema-publisher-orb@0.1.0

jobs:
  build:
    docker:
      - image: cimg/base:current
    steps:
      - checkout
      - persist_to_workspace:
          root: ~/project
          paths:
            - protos/*.protos
workflows:
  publish-protos:
    jobs:
      - build
      - publisher/publish:
          requires:
            - build
          pre-steps:
            - attach_workspace:
                at: /tmp/output
          schemaId: "7e8c3d9c-ed21-475e-832f-794abae3deac"
          schemaName: "CircleCI test"
          schemaType: "protobuf"
          artifactType: "protos_archive"
          rootDir: "/tmp/output/protos"

Last updated