File tree Expand file tree Collapse file tree 4 files changed +31
-9
lines changed Expand file tree Collapse file tree 4 files changed +31
-9
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ generate-testdata: ## Update/generate the testdata in $GOPATH/src/sigs.k8s.io/ku
73
73
74
74
.PHONY : generate-docs
75
75
generate-docs : # # Update/generate the docs in $GOPATH/src/sigs.k8s.io/kubebuilder
76
- go run hack/docs/generate_samples.go
76
+ ./ hack/docs/generate.sh
77
77
78
78
.PHONY : check-docs
79
79
check-docs : # # Run the script to ensure that the docs are updated
Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
- source " $( dirname " $0 " ) /../../test/common.sh"
18
-
19
- build_kb
20
-
21
17
check_directory=" $( dirname " $0 " ) /../../docs/book/src/"
22
18
23
19
# Check docs directory first. If there are any uncommitted change, fail the test.
@@ -27,7 +23,8 @@ if [[ $(git status ${check_directory} --porcelain) ]]; then
27
23
exit 1
28
24
fi
29
25
30
- make generate-docs
26
+
27
+ $( dirname " $0 " ) /generate.sh
31
28
32
29
# Check if there are any changes to files under testdata directory.
33
30
if [[ $( git status ${check_directory} --porcelain) ]]; then
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Copyright 2023 The Kubernetes Authors.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ source " $( dirname " $0 " ) /../../test/common.sh"
18
+
19
+ build_kb
20
+
21
+ docs_gen_directory=" $( dirname " $0 " ) /../../hack/docs/generate_samples.go"
22
+ go run ${docs_gen_directory}
23
+
Original file line number Diff line number Diff line change @@ -21,9 +21,11 @@ import (
21
21
22
22
componentconfig "sigs.k8s.io/kubebuilder/v3/hack/docs/internal/component-config-tutorial"
23
23
cronjob "sigs.k8s.io/kubebuilder/v3/hack/docs/internal/cronjob-tutorial"
24
- "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
25
24
)
26
25
26
+ // Make sure executing `build_kb` to generate kb executable from the source code
27
+ const KubebuilderBinName = "/tmp/kubebuilder/bin/kubebuilder"
28
+
27
29
func main () {
28
30
fmt .Println ("Generating documents..." )
29
31
@@ -36,7 +38,7 @@ func main() {
36
38
}
37
39
38
40
func UpdateComponentConfigTutorial () {
39
- binaryPath := util . KubebuilderBinName
41
+ binaryPath := KubebuilderBinName
40
42
samplePath := "docs/book/src/component-config-tutorial/testdata/project/"
41
43
42
44
sp := componentconfig .NewSample (binaryPath , samplePath )
@@ -51,7 +53,7 @@ func UpdateComponentConfigTutorial() {
51
53
}
52
54
53
55
func UpdateCronjobTutorial () {
54
- binaryPath := util . KubebuilderBinName
56
+ binaryPath := KubebuilderBinName
55
57
samplePath := "docs/book/src/cronjob-tutorial/testdata/project/"
56
58
57
59
sp := cronjob .NewSample (binaryPath , samplePath )
You can’t perform that action at this time.
0 commit comments