...

Text file src/sigs.k8s.io/gateway-api/hack/build-install-yaml.sh

Documentation: sigs.k8s.io/gateway-api/hack

     1#!/usr/bin/env bash
     2
     3# Copyright 2022 The Kubernetes Authors.
     4#
     5# Licensed under the Apache License, Version 2.0 (the "License");
     6# you may not use this file except in compliance with the License.
     7# You may obtain a copy of the License at
     8#
     9#     http://www.apache.org/licenses/LICENSE-2.0
    10#
    11# Unless required by applicable law or agreed to in writing, software
    12# distributed under the License is distributed on an "AS IS" BASIS,
    13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14# See the License for the specific language governing permissions and
    15# limitations under the License.
    16
    17set -o errexit
    18set -o nounset
    19set -o pipefail
    20
    21thisyear=`date +"%Y"`
    22
    23mkdir -p release/
    24
    25# Make clean files with boilerplate
    26cat hack/boilerplate/boilerplate.sh.txt > release/experimental-install.yaml
    27sed -i "s/YEAR/$thisyear/g" release/experimental-install.yaml
    28cat << EOF >> release/experimental-install.yaml
    29#
    30# Gateway API Experimental channel install
    31#
    32EOF
    33
    34cat hack/boilerplate/boilerplate.sh.txt > release/standard-install.yaml
    35sed -i "s/YEAR/$thisyear/g" release/standard-install.yaml
    36cat << EOF >> release/standard-install.yaml
    37#
    38# Gateway API Standard channel install
    39#
    40EOF
    41
    42cat hack/boilerplate/boilerplate.sh.txt > release/webhook-install.yaml
    43sed -i "s/YEAR/$thisyear/g" release/webhook-install.yaml
    44cat << EOF >> release/webhook-install.yaml
    45#
    46# Gateway API deprecated webhook install
    47#
    48EOF
    49
    50for file in `ls config/crd/experimental/gateway*.yaml`
    51do
    52    echo "---" >> release/experimental-install.yaml
    53    echo "#" >> release/experimental-install.yaml
    54    echo "# $file" >> release/experimental-install.yaml
    55    echo "#" >> release/experimental-install.yaml
    56    cat $file >> release/experimental-install.yaml
    57done
    58
    59for file in `ls config/crd/standard/*.yaml`
    60do
    61    echo "---" >> release/standard-install.yaml
    62    echo "#" >> release/standard-install.yaml
    63    echo "# $file" >> release/standard-install.yaml
    64    echo "#" >> release/standard-install.yaml
    65    cat $file >> release/standard-install.yaml
    66done
    67
    68for file in `ls config/webhook/*.yaml`
    69do
    70    echo "---" >> release/webhook-install.yaml
    71    echo "#" >> release/webhook-install.yaml
    72    echo "# $file" >> release/webhook-install.yaml
    73    echo "#" >> release/webhook-install.yaml
    74    cat $file >> release/webhook-install.yaml
    75done
    76
    77echo "Generated:" release/*-install.yaml

View as plain text