Skip to content

Commit

Permalink
[INFOPLAT-1427] Action to deploy Protobuf/AVRO schemas to Confluent S…
Browse files Browse the repository at this point in the history
…chema Registry (#850)

* beholder pulumi schema deploy

* pin image for testing

* shell

* set up env for job

* set up env

* tighter env per command

* fix secrets

* fix acc id

* remove aws setup

* fmt

* shell

* again

* minimal action

* full pipeline

* image, preview

* fix command

* add env and path

* kafka keys

* mount volume

* remove comment

* fix bucket name

* remove pulumi setup

* changeset

* remove preview flag

* point action to qa-latest

* shorter tag
  • Loading branch information
nanchano authored Feb 4, 2025
1 parent c97cc89 commit 95fe22c
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-wasps-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"beholder-pulumi-deploy-schema": major
---

Schema deployment to Schema Registry using RTSP's in-house tool
3 changes: 3 additions & 0 deletions actions/beholder-pulumi-deploy-schema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# beholder-pulumi-deploy-schema

> Validates and deploys a Protobuf or AVRO schema to Confluent Schema Registry
70 changes: 70 additions & 0 deletions actions/beholder-pulumi-deploy-schema/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: beholder-pulumi-deploy-schema
description:
"Validates and deploys a Protobuf or AVRO schema to Confluent Schema Registry"

inputs:
pulumi_s3_bucket:
description: "S3 bucket name to use as Pulumi backend"
required: true
deploy_environment:
description: "Deployment environment"
required: true
deploy_config_path:
description: "Path to the deploy config YAML file"
required: true
aws_account_id:
description: "AWS Account ID"
required: false
default: "654654554896"
aws_region:
description: "AWS region"
required: false
default: "us-west-2"

runs:
using: "composite"
steps:
- uses: actions/[email protected]

- name: Docker login to ECR
shell: bash
run: |
aws ecr get-login-password --region ${{ inputs.aws_region }} \
| docker login --username AWS --password-stdin \
${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_region }}.amazonaws.com
- name: Pull container image
shell: bash
run: |
docker pull ${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_region }}.amazonaws.com/atlas-beholder-pulumi:qa-latest
docker tag ${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_region }}.amazonaws.com/atlas-beholder-pulumi:qa-latest atlas-beholder-pulumi
- name: Deploy schema
shell: bash
run: |
docker run \
-v "$PWD:/workspace" \
-w /workspace \
-e AWS_REGION=${{ inputs.aws_region }} \
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
-e AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} \
-e DEPLOY_ENVIRONMENT=${{ inputs.deploy_environment }} \
-e DEPLOY_CONFIG_PATH=${{ inputs.deploy_config_path }} \
-e PULUMI_S3_BUCKET=${{ inputs.pulumi_s3_bucket }} \
-e CONFLUENT_CLOUD_API_KEY=${CONFLUENT_CLOUD_API_KEY} \
-e CONFLUENT_CLOUD_API_SECRET=${CONFLUENT_CLOUD_API_SECRET} \
-e SCHEMA_REGISTRY_KEY=${SCHEMA_REGISTRY_KEY} \
-e SCHEMA_REGISTRY_SECRET=${SCHEMA_REGISTRY_SECRET} \
-e PULUMI_CONFIG_PASSPHRASE=${PULUMI_CONFIG_PASSPHRASE} \
-e KAFKA_REST_KEY=${KAFKA_REST_KEY} \
-e KAFKA_REST_SECRET=${KAFKA_REST_SECRET} \
atlas-beholder-pulumi beholder-pulumi deploy-schemas
env:
CONFLUENT_CLOUD_API_KEY: ${{ env.CONFLUENT_CLOUD_API_KEY }}
CONFLUENT_CLOUD_API_SECRET: ${{ env.CONFLUENT_CLOUD_API_SECRET }}
SCHEMA_REGISTRY_KEY: ${{ env.SCHEMA_REGISTRY_KEY }}
SCHEMA_REGISTRY_SECRET: ${{ env.SCHEMA_REGISTRY_SECRET }}
PULUMI_CONFIG_PASSPHRASE: ${{ env.PULUMI_CONFIG_PASSPHRASE }}
KAFKA_REST_KEY: ${{ env.KAFKA_REST_KEY }}
KAFKA_REST_SECRET: ${{ env.KAFKA_REST_SECRET }}
11 changes: 11 additions & 0 deletions actions/beholder-pulumi-deploy-schema/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "beholder-pulumi-deploy-schema",
"version": "0.0.0",
"description": "",
"private": true,
"scripts": {},
"author": "@smartcontractkit",
"license": "MIT",
"dependencies": {},
"repository": "https://github.com/smartcontractkit/.github"
}
7 changes: 7 additions & 0 deletions actions/beholder-pulumi-deploy-schema/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "beholder-pulumi-deploy-schema",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "actions/beholder-pulumi-deploy-schema",
"targets": {}
}

0 comments on commit 95fe22c

Please sign in to comment.