mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-08-21 06:36:20 +00:00
./hack/module.sh learns codegen command
Runs code generation on a per-module basis. If `CONTAINED` is not set the code generation is run in a container. Mount point in docker is randomzied to simulate Concourse. Introduce K8S_PKG_VERSION to make room to build different versions eventually.
This commit is contained in:
+6
-1
@@ -33,6 +33,10 @@ function unittest_cmd() {
|
||||
echo "${cmd} -short -race ./..."
|
||||
}
|
||||
|
||||
function codegen_cmd() {
|
||||
echo "${ROOT}/hack/codegen.sh codegen::generate"
|
||||
}
|
||||
|
||||
# The race detector is slow, so sometimes you don't want to use it
|
||||
function unittest_no_race_cmd() {
|
||||
if [ -x "$(command -v gotest)" ]; then
|
||||
@@ -62,7 +66,7 @@ function with_modules() {
|
||||
|
||||
function usage() {
|
||||
echo "Error: <task> must be specified"
|
||||
echo " do.sh <task> [tidy, lint, test, unittest, unittest_no_race]"
|
||||
echo " do.sh <task> [tidy, lint, test, unittest, unittest_no_race, codegen]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -73,6 +77,7 @@ function main() {
|
||||
'test') with_modules 'test_cmd' ;;
|
||||
'unittest') with_modules 'unittest_cmd' ;;
|
||||
'unittest_no_race') with_modules 'unittest_no_race_cmd' ;;
|
||||
'codegen') with_modules 'codegen_cmd' ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user