-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Moved boilerplate headers to external files - Update-codegen.sh improvements: - Add header argument to update-codegen.sh - required for k8s 1.18 - Ensure GOPATH is set - required for k8s 1.18 - Use script root instead of git root, make code-gen path relative to script root - generate-fakes improvements - Call counterfieter from GOPATH - Add header text from boilerplate - Add generate Makefile target to create client, deepcopies, fakes, and copyright. Updated travis to install counterfeiter and verify generated code. - Update docs/development/testing.md to inform contributors of the verification step in Travis.
- Loading branch information
1 parent
5b7de61
commit 2b4cece
Showing
11 changed files
with
88 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,12 +96,14 @@ push-image: | |
release: | ||
hack/release.sh | ||
|
||
.PHONY: gen-copyright | ||
gen-copyright: | ||
.PHONY: generate | ||
generate: | ||
hack/generate-client.sh | ||
hack/generate-fakes.sh | ||
hack/generate-copyright.sh | ||
|
||
.PHONY: verify-copyright | ||
verify-copyright: gen-copyright | ||
.PHONY: verify-codegen | ||
verify-codegen: generate | ||
# TODO: Fix travis issue with ginkgo install updating go.mod and go.sum | ||
# TODO: Verify vendor tree is accurate | ||
git diff --quiet -- ':(exclude)go.mod' ':(exclude)go.sum' ':(exclude)vendor/*' | ||
|
@@ -114,6 +116,9 @@ install-ginkgo: | |
install-gocov: | ||
cd && GO111MODULE=on go get github.com/axw/gocov/[email protected] | ||
|
||
install-counterfeiter: | ||
hack/install-counterfeiter.sh | ||
|
||
# https://github.com/shipwright-io/build/issues/123 | ||
test: test-unit | ||
|
||
|
@@ -201,6 +206,6 @@ kind: | |
./hack/install-kind.sh | ||
./hack/install-registry.sh | ||
|
||
travis: install-ginkgo install-gocov kubectl kind | ||
travis: install-counterfeiter install-ginkgo install-gocov kubectl kind | ||
./hack/install-tekton.sh | ||
./hack/install-operator-sdk.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Copyright The Shipwright Contributors | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!-- | ||
Copyright The Shipwright Contributors | ||
|
||
SPDX-License-Identifier: Apache-2.0 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Copyright The Shipwright Contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Copyright The Shipwright Contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# | ||
# Generates the typed client for Kubernetes CRDs | ||
# From https://www.openshift.com/blog/kubernetes-deep-dive-code-generation-customresources | ||
# | ||
|
||
set -euo pipefail | ||
|
||
GOPATH=${GOPATH:-$(go env GOPATH)} | ||
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | ||
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../../../k8s.io/code-generator)} | ||
|
||
echo "" | ||
echo "Using code-generator package version, as instructed in the go.mod file" | ||
echo "The code-generator package is imported via the pkg/kubecodegen dir" | ||
echo "To modify the current version, please modify this in the go.mod" | ||
echo "" | ||
|
||
GOFLAGS="" GOPATH=${GOPATH} /bin/bash ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client" \ | ||
github.com/shipwright-io/build/pkg/client/build \ | ||
github.com/shipwright-io/build/pkg/apis \ | ||
build:v1alpha1 \ | ||
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
GO111MODULE=off go get -u github.com/maxbrunsfeld/counterfeiter |
This file was deleted.
Oops, something went wrong.