2017-10-28 14:08:31 -07:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
2018-06-04 23:33:56 +02:00
|
|
|
# Copyright 2018 The Rook Authors. All rights reserved.
|
2017-10-28 14:08:31 -07:00
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
2021-01-25 17:51:24 -07:00
|
|
|
GROUP_VERSIONS="rook.io:v1 rook.io:v1alpha2 ceph.rook.io:v1 nfs.rook.io:v1alpha1 cassandra.rook.io:v1alpha1 yugabytedb.rook.io:v1alpha1"
|
2020-03-08 15:12:57 +09:00
|
|
|
|
2017-10-28 14:08:31 -07:00
|
|
|
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
2020-03-15 13:51:42 +09:00
|
|
|
codegendir="${scriptdir}/../../vendor/k8s.io/code-generator"
|
2017-10-28 14:08:31 -07:00
|
|
|
|
2021-01-28 17:07:25 +01:00
|
|
|
# ensures the vendor dir has the right deps, e,g. code-generator
|
|
|
|
|
go mod vendor
|
|
|
|
|
|
|
|
|
|
# run code generation
|
2020-03-15 13:51:42 +09:00
|
|
|
bash ${codegendir}/generate-groups.sh \
|
2018-06-09 15:43:50 +02:00
|
|
|
all \
|
|
|
|
|
github.com/rook/rook/pkg/client \
|
|
|
|
|
github.com/rook/rook/pkg/apis \
|
2020-03-30 15:34:24 +09:00
|
|
|
"${GROUP_VERSIONS}" \
|
2021-01-28 17:07:25 +01:00
|
|
|
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
|
2020-03-30 15:34:24 +09:00
|
|
|
--go-header-file "${scriptdir}/boilerplate.go.txt"
|