Skip to content

Conversation

@danilopopeye
Copy link
Contributor

This PR is the first of a series as a followup of the #502 just using the latest version of the provider-aws-* providers.

PR Checklist

#!/usr/bin/env bash

# shellcheck disable=SC2064
set -euo pipefail

GROUP=${1:-*}

if [ "$GROUP" = "*" ]; then
  echo "WARN running for all groups" >&2
fi

echo "INFO clean up SCHEMAS directory" >&2
rm -rf "$PWD/SCHEMAS"/*

if [ ! -d ./provider-upjet-aws ]; then
  git clone --depth 1 --branch v2.1.1 https://github.com/crossplane-contrib/provider-upjet-aws.git
fi

find ./provider-upjet-aws/package/crds -type f -name "${GROUP}_*.yaml" \
  | while read -r file; do
    dir_name=$(basename "$file" | cut -d_ -f1)
    file_name=$(basename "$file")

    echo "Processing $dir_name / $file_name"

    mkdir -p "SCHEMAS/$dir_name"
    cp "$file" "SCHEMAS/$dir_name/$file_name"

    pushd "SCHEMAS/$dir_name" > /dev/null
    python ../../openapi2jsonschema.py "$file_name"
    rm -rf "$file_name"
    popd > /dev/null

    echo
  done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants