ContainerImage.Pinniped/hack/update.sh
Matt Moyer 9760c03617
Do codegen across all version in parallel.
This only matters for local development, since we don't use this script directly in CI. Makes the full codegen ste take ~90s on my laptop.

Signed-off-by: Matt Moyer <moyerm@vmware.com>
2020-10-30 11:12:53 -05:00

27 lines
993 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright 2020 the Pinniped contributors. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
# Generate code.
xargs -n 1 -P 8 "$ROOT/hack/lib/update-codegen.sh" < "${ROOT}/hack/lib/kube-versions.txt"
# Copy each CRD yaml to the app which should cause it to be installed.
cp "$ROOT"/generated/1.19/crds/*oidcproviderconfigs.yaml "$ROOT/deploy/supervisor"
cp "$ROOT"/generated/1.19/crds/*credentialissuerconfigs.yaml "$ROOT/deploy/concierge"
cp "$ROOT"/generated/1.19/crds/*webhookidentityproviders.yaml "$ROOT/deploy/concierge"
# Make sure we didn't miss any new CRDs.
crdCount=$(find "$ROOT"/generated/1.19/crds/ -maxdepth 1 -type f -name '*.yaml' | wc -l | tr -d ' ')
if [[ "$crdCount" != "3" ]]; then
echo "Looks like you added a new CRD. Please update this update.sh script to decide where to copy it and then run it again."
exit 1
fi
# Tidy.
"$ROOT/hack/module.sh" tidy