2018-02-16 20:58:02 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# Copyright 2017 The Kubernetes Authors.
|
|
|
|
|
#
|
|
|
|
|
# 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.
|
|
|
|
|
|
2020-05-31 21:11:28 +00:00
|
|
|
set -x
|
2018-02-16 20:58:02 +00:00
|
|
|
set -o errexit
|
|
|
|
|
set -o nounset
|
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
|
|
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..
|
2020-05-26 16:15:38 +00:00
|
|
|
. ${SCRIPT_ROOT}/hack/versions.sh
|
|
|
|
|
CODEGEN_PKG=$GOPATH/pkg/mod/k8s.io/code-generator@${kube_version}
|
2020-05-31 21:11:28 +00:00
|
|
|
TARGET_SCRIPT=/tmp/generate-groups.sh
|
2020-05-26 16:15:38 +00:00
|
|
|
|
2020-05-31 21:11:28 +00:00
|
|
|
(
|
|
|
|
|
cd $CODEGEN_PKG
|
|
|
|
|
go install ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}
|
|
|
|
|
)
|
2020-05-26 16:15:38 +00:00
|
|
|
|
2020-05-31 21:11:28 +00:00
|
|
|
export GO111MODULE=off
|
2018-02-16 20:58:02 +00:00
|
|
|
|
2020-05-31 21:11:28 +00:00
|
|
|
sed -e '/go install/d' ${CODEGEN_PKG}/generate-groups.sh > ${TARGET_SCRIPT}
|
|
|
|
|
|
2021-04-01 18:44:18 +00:00
|
|
|
export GO111MODULE=on
|
|
|
|
|
|
|
|
|
|
[ -e ./v2 ] || ln -s . v2
|
2020-05-31 21:11:28 +00:00
|
|
|
bash -x ${TARGET_SCRIPT} "deepcopy,client,informer,lister" \
|
2021-04-01 18:44:18 +00:00
|
|
|
github.com/argoproj/argo-cd/v2/pkg/client github.com/argoproj/argo-cd/v2/pkg/apis \
|
2018-02-17 00:13:58 +00:00
|
|
|
"application:v1alpha1" \
|
2018-02-16 20:58:02 +00:00
|
|
|
--go-header-file ${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt
|
2021-04-01 18:44:18 +00:00
|
|
|
[ -e ./v2 ] && rm -rf v2
|