Auto-format build.sh and deploy.sh

Co-authored-by: Benjamin A. Petersen <ben@benjaminapetersen.me>
This commit is contained in:
Ryan Richard
2023-11-08 13:45:48 -08:00
parent d4e2622ea8
commit b61557d3c3
2 changed files with 10 additions and 11 deletions

View File

@@ -67,8 +67,7 @@ mkdir -p "${dest_dir}"
# Generate the OpenAPI v3 Schema files, imgpkg images.yml files
declare -a packages_to_build=("local-user-authenticator" "pinniped-concierge" "pinniped-supervisor")
for resource_name in "${packages_to_build[@]}"
do
for resource_name in "${packages_to_build[@]}"; do
resource_qualified_name="${resource_name}.${api_group_suffix}"
package_repo_tag="${package_repo_prefix}-${resource_name}:${tag}"
@@ -85,9 +84,10 @@ do
cp "${resource_package_template_source_dir}/vendir.yml" "${resource_destination_dir}/vendir.yml"
cp "${resource_package_template_source_dir}/release_notes.txt" "${resource_destination_dir}/release_notes.txt" # dummy
log_note "Vendir sync deploy directory for ${resource_name} to package bundle..."
pushd "${resource_destination_dir}" > /dev/null
vendir sync
popd > /dev/null
pushd "${resource_destination_dir}" >/dev/null
vendir sync
popd >/dev/null
log_note "Generating OpenAPI v3 schema for ${resource_name}..."
ytt \
@@ -99,7 +99,7 @@ do
log_note "Generating .imgpkg/images.yml for ${resource_name}..."
mkdir -p "${resource_destination_dir}/.imgpkg"
ytt \
--file "${resource_config_destination_dir}" | \
--file "${resource_config_destination_dir}" |
kbld -f- --imgpkg-lock-output "${resource_destination_dir}/.imgpkg/images.yml"
log_note "Pushing Pinniped ${resource_name} Package bundle..."
@@ -118,7 +118,7 @@ do
--data-value-file openapi="${resource_destination_dir}/schema-openapi.yml" \
--data-value-file releaseNotes="${resource_destination_dir}/release_notes.txt" \
--data-value repo_host="${package_repo_prefix}-${resource_name}" \
--data-value version="${pinniped_package_version}" > "${package_repository_dir}/${pinniped_package_version}.yml"
--data-value version="${pinniped_package_version}" >"${package_repository_dir}/${pinniped_package_version}.yml"
cp "${resource_package_template_source_dir}/metadata.yml" "${package_repository_dir}/metadata.yml"
done

View File

@@ -21,7 +21,6 @@ cd "$hack_lib_path/../../" || exit 1
source hack/lib/helpers.sh
# Expected arguments.
app=${1:-"app-argument-not-provided"}
tag=${2:-"tag-argument-not-provided"}
@@ -62,7 +61,7 @@ mkdir -p "${dest_dir}/install"
log_note "Deploying Pinniped PackageRepository..."
pinniped_package_repository_name="pinniped-package-repository"
pinniped_package_repository_file="${dest_dir}/install/packagerepository.${pinniped_package_version}.yml"
cat <<EOT > "${pinniped_package_repository_file}"
cat <<EOT >"${pinniped_package_repository_file}"
---
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageRepository
@@ -89,7 +88,7 @@ pinniped_package_rbac_file="${dest_dir}/install/${pinniped_package_rbac_prefix}-
# For any other use case, the generated artifacts should be properly reviewed.
# For example, the RBAC generated here should be adjusted to conform to the
# principle of LEAST privilege.
cat <<EOF > "${pinniped_package_rbac_file}"
cat <<EOF >"${pinniped_package_rbac_file}"
---
apiVersion: v1
kind: Namespace
@@ -136,7 +135,7 @@ PACKAGE_INSTALL_FILE_NAME="${dest_dir}/install/${resource_name}-pkginstall.yml"
SECRET_NAME="${resource_name}-package-install-secret"
log_note "Generating ${PACKAGE_INSTALL_FILE_NAME}..."
cat > "${PACKAGE_INSTALL_FILE_NAME}" << EOF
cat >"${PACKAGE_INSTALL_FILE_NAME}" <<EOF
---
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageInstall