File tree Expand file tree Collapse file tree 5 files changed +21
-6
lines changed
pkg/apis/acid.zalan.do/v1 Expand file tree Collapse file tree 5 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 2020 - name : Compile
2121 run : make linux
2222 - name : Run unit tests
23- run : go test ./...
23+ run : make test
2424 - name : Run end-2-end tests
2525 run : make e2e
Original file line number Diff line number Diff line change @@ -103,5 +103,8 @@ test:
103103 hack/verify-codegen.sh
104104 GO111MODULE=on go test ./...
105105
106+ codegen :
107+ hack/update-codegen.sh
108+
106109e2e : docker # build operator image to be tested
107110 cd e2e; make e2etest
Original file line number Diff line number Diff line change @@ -4,10 +4,22 @@ set -o errexit
44set -o nounset
55set -o pipefail
66
7+ GENERATED_PACKAGE_ROOT=" github.com"
8+ OPERATOR_PACKAGE_ROOT=" ${GENERATED_PACKAGE_ROOT} /zalando/postgres-operator"
79SCRIPT_ROOT=$( dirname ${BASH_SOURCE} ) /..
8- 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)}
10+ TARGET_CODE_DIR=${1-${SCRIPT_ROOT} / pkg}
11+ 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)}
12+
13+ cleanup () {
14+ rm -rf " ${GENERATED_PACKAGE_ROOT} "
15+ }
16+ trap " cleanup" EXIT SIGINT
917
1018bash " ${CODEGEN_PKG} /generate-groups.sh" all \
11- github.com/zalando/postgres-operator/ pkg/generated github.com/zalando/postgres-operator/ pkg/apis \
19+ " ${OPERATOR_PACKAGE_ROOT} / pkg/generated" " ${OPERATOR_PACKAGE_ROOT} / pkg/apis" \
1220 " acid.zalan.do:v1" \
1321 --go-header-file " ${SCRIPT_ROOT} " /hack/custom-boilerplate.go.txt
22+
23+ cp -r " ${OPERATOR_PACKAGE_ROOT} " /pkg/* " ${TARGET_CODE_DIR} "
24+
25+ cleanup
Original file line number Diff line number Diff line change @@ -19,15 +19,14 @@ cleanup
1919mkdir -p " ${TMP_DIFFROOT} "
2020cp -a " ${DIFFROOT} " /* " ${TMP_DIFFROOT} "
2121
22- " ${SCRIPT_ROOT} /hack/update-codegen.sh"
22+ " ${SCRIPT_ROOT} /hack/update-codegen.sh" " ${TMP_DIFFROOT} "
2323echo " diffing ${DIFFROOT} against freshly generated codegen"
2424ret=0
2525diff -Naupr " ${DIFFROOT} " " ${TMP_DIFFROOT} " || ret=$?
26- cp -a " ${TMP_DIFFROOT} " /* " ${DIFFROOT} "
2726if [[ $ret -eq 0 ]]
2827then
2928 echo " ${DIFFROOT} up to date."
3029else
31- echo " ${DIFFROOT} is out of date. Please run hack/update- codegen.sh "
30+ echo " ${DIFFROOT} is out of date. Please run 'make codegen' "
3231 exit 1
3332fi
You can’t perform that action at this time.
0 commit comments