github.com/verrazzano/verrazzano@v1.7.0/application-operator/hack/add-crd-header.sh (about)

     1  #!/bin/bash
     2  # Copyright (c) 2020, 2023, Oracle and/or its affiliates.
     3  # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     4  
     5  # Add YAML boilerplate to generated CRDs - kubebuilder currently does not seem to have a way to
     6  # add boilerplate headers to these - only to generated Go files
     7  
     8  set -o errexit
     9  set -o nounset
    10  set -o pipefail
    11  
    12  SCRIPT_DIR=$(cd $(dirname "$0"); pwd -P)
    13  GENERATED_APP_CRDS_DIR=${SCRIPT_DIR}/../../platform-operator/helm_config/charts/verrazzano-application-operator/crds
    14  GENERATED_MC_CRDS_DIR=${SCRIPT_DIR}/../../platform-operator/helm_config/charts/verrazzano-cluster-agent/crds
    15  
    16  # The following two steps are required to handle the cases of running "make manifests" when there
    17  # are and are not api changes.  This is necessary because fix-copyright currently cannot handle both
    18  # cases correctly with the same set of options.
    19  
    20  # First put in the headers from the Git history
    21  go run ${SCRIPT_DIR}/../../tools/fix-copyright/copyright.go -useExistingUpdateYearFromHeader $GENERATED_APP_CRDS_DIR
    22  go run ${SCRIPT_DIR}/../../tools/fix-copyright/copyright.go -useExistingUpdateYearFromHeader $GENERATED_MC_CRDS_DIR
    23  
    24  # Then fix the updated year for files that were modified this year
    25  go run ${SCRIPT_DIR}/../../tools/fix-copyright/copyright.go  $GENERATED_APP_CRDS_DIR
    26  go run ${SCRIPT_DIR}/../../tools/fix-copyright/copyright.go $GENERATED_MC_CRDS_DIR