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 20
20
- name : Compile
21
21
run : make linux
22
22
- name : Run unit tests
23
- run : go test ./...
23
+ run : make test
24
24
- name : Run end-2-end tests
25
25
run : make e2e
Original file line number Diff line number Diff line change @@ -103,5 +103,8 @@ test:
103
103
hack/verify-codegen.sh
104
104
GO111MODULE=on go test ./...
105
105
106
+ codegen :
107
+ hack/update-codegen.sh
108
+
106
109
e2e : docker # build operator image to be tested
107
110
cd e2e; make e2etest
Original file line number Diff line number Diff line change @@ -4,10 +4,22 @@ set -o errexit
4
4
set -o nounset
5
5
set -o pipefail
6
6
7
+ GENERATED_PACKAGE_ROOT=" github.com"
8
+ OPERATOR_PACKAGE_ROOT=" ${GENERATED_PACKAGE_ROOT} /zalando/postgres-operator"
7
9
SCRIPT_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
9
17
10
18
bash " ${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" \
12
20
" acid.zalan.do:v1" \
13
21
--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
19
19
mkdir -p " ${TMP_DIFFROOT} "
20
20
cp -a " ${DIFFROOT} " /* " ${TMP_DIFFROOT} "
21
21
22
- " ${SCRIPT_ROOT} /hack/update-codegen.sh"
22
+ " ${SCRIPT_ROOT} /hack/update-codegen.sh" " ${TMP_DIFFROOT} "
23
23
echo " diffing ${DIFFROOT} against freshly generated codegen"
24
24
ret=0
25
25
diff -Naupr " ${DIFFROOT} " " ${TMP_DIFFROOT} " || ret=$?
26
- cp -a " ${TMP_DIFFROOT} " /* " ${DIFFROOT} "
27
26
if [[ $ret -eq 0 ]]
28
27
then
29
28
echo " ${DIFFROOT} up to date."
30
29
else
31
- echo " ${DIFFROOT} is out of date. Please run hack/update- codegen.sh "
30
+ echo " ${DIFFROOT} is out of date. Please run 'make codegen' "
32
31
exit 1
33
32
fi
You can’t perform that action at this time.
0 commit comments