mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 18:28:06 +02:00
Make test fails due to keeping github.com autogenerated folder in root (#1713)
This commit is contained in:
+14
-2
@@ -4,10 +4,22 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
GENERATED_PACKAGE_ROOT="github.com"
|
||||
OPERATOR_PACKAGE_ROOT="${GENERATED_PACKAGE_ROOT}/zalando/postgres-operator"
|
||||
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..
|
||||
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ${GOPATH}/src/k8s.io/code-generator)}
|
||||
TARGET_CODE_DIR=${1-${SCRIPT_ROOT}/pkg}
|
||||
CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo "${GOPATH}"/src/k8s.io/code-generator)}
|
||||
|
||||
cleanup() {
|
||||
rm -rf "${GENERATED_PACKAGE_ROOT}"
|
||||
}
|
||||
trap "cleanup" EXIT SIGINT
|
||||
|
||||
bash "${CODEGEN_PKG}/generate-groups.sh" all \
|
||||
github.com/zalando/postgres-operator/pkg/generated github.com/zalando/postgres-operator/pkg/apis \
|
||||
"${OPERATOR_PACKAGE_ROOT}/pkg/generated" "${OPERATOR_PACKAGE_ROOT}/pkg/apis" \
|
||||
"acid.zalan.do:v1" \
|
||||
--go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt
|
||||
|
||||
cp -r "${OPERATOR_PACKAGE_ROOT}"/pkg/* "${TARGET_CODE_DIR}"
|
||||
|
||||
cleanup
|
||||
|
||||
Reference in New Issue
Block a user