Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
24dcc9bf
Commit
24dcc9bf
authored
Oct 19, 2015
by
nikhiljindal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a script to verify api reference docs
parent
034f7ccb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
3 deletions
+63
-3
update-api-reference-docs.sh
hack/update-api-reference-docs.sh
+16
-3
verify-api-reference-docs.sh
hack/verify-api-reference-docs.sh
+47
-0
No files found.
hack/
gen-swagger-doc/run-gen-swagger
-docs.sh
→
hack/
update-api-reference
-docs.sh
View file @
24dcc9bf
...
@@ -14,14 +14,25 @@
...
@@ -14,14 +14,25 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Generates updated api-reference docs from the latest swagger spec.
# Usage: ./update-api-reference-docs.sh <absolute output path>
set
-o
errexit
set
-o
errexit
set
-o
nounset
set
-o
nounset
set
-o
pipefail
set
-o
pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
V1_PATH
=
"
$PWD
/
${
KUBE_ROOT
}
/docs/api-reference/v1/"
DEFAULT_OUTPUT_PATH
=
"
$PWD
/
${
KUBE_ROOT
}
/docs/api-reference"
V1BETA1_PATH
=
"
$PWD
/
${
KUBE_ROOT
}
/docs/api-reference/extensions/v1beta1"
OUTPUT
=
${
1
:-${
DEFAULT_OUTPUT_PATH
}}
echo
"Generating api reference docs at
${
OUTPUT
}
"
V1_PATH
=
"
${
OUTPUT
}
/v1/"
V1BETA1_PATH
=
"
${
OUTPUT
}
/extensions/v1beta1"
SWAGGER_PATH
=
"
$PWD
/
${
KUBE_ROOT
}
/api/swagger-spec/"
SWAGGER_PATH
=
"
$PWD
/
${
KUBE_ROOT
}
/api/swagger-spec/"
echo
"Reading swagger spec from:
${
SWAGGER_PATH
}
"
mkdir
-p
$V1_PATH
mkdir
-p
$V1_PATH
mkdir
-p
$V1BETA1_PATH
mkdir
-p
$V1BETA1_PATH
...
@@ -32,3 +43,5 @@ docker run -v $V1_PATH:/output -v ${SWAGGER_PATH}:/swagger-source gcr.io/google_
...
@@ -32,3 +43,5 @@ docker run -v $V1_PATH:/output -v ${SWAGGER_PATH}:/swagger-source gcr.io/google_
docker run
-v
$V1BETA1_PATH
:/output
-v
${
SWAGGER_PATH
}
:/swagger-source gcr.io/google_containers/gen-swagger-docs:v3
\
docker run
-v
$V1BETA1_PATH
:/output
-v
${
SWAGGER_PATH
}
:/swagger-source gcr.io/google_containers/gen-swagger-docs:v3
\
v1beta1
\
v1beta1
\
https://raw.githubusercontent.com/kubernetes/kubernetes/master/pkg/apis/extensions/v1beta1/register.go
https://raw.githubusercontent.com/kubernetes/kubernetes/master/pkg/apis/extensions/v1beta1/register.go
# ex: ts=2 sw=2 et filetype=sh
hack/verify-api-reference-docs.sh
0 → 100755
View file @
24dcc9bf
#!/bin/bash
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Verifies that api reference docs are upto date.
set
-o
errexit
set
-o
nounset
set
-o
pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
kube::golang::setup_env
API_REFERENCE_DOCS_ROOT
=
"
${
KUBE_ROOT
}
/docs/api-reference"
TMP_OUTPUT_DIR
=
"
${
KUBE_ROOT
}
/_tmp/api-reference"
TMP_ROOT
=
"
${
KUBE_ROOT
}
/_tmp"
# Generate API reference docs in tmp.
"./hack/update-api-reference-docs.sh"
"
${
TMP_OUTPUT_DIR
}
"
echo
"diffing
${
API_REFERENCE_DOCS_ROOT
}
against freshly generated docs"
ret
=
0
diff
-Naupr
-I
'Last update'
--exclude
=
*
.md
"
${
API_REFERENCE_DOCS_ROOT
}
"
"
${
TMP_OUTPUT_DIR
}
"
||
ret
=
$?
rm
-rf
"
${
TMP_ROOT
}
"
if
[[
$ret
-eq
0
]]
then
echo
"
${
API_REFERENCE_DOCS_ROOT
}
up to date."
else
echo
"
${
API_REFERENCE_DOCS_ROOT
}
is out of date. Please run hack/update-api-reference-docs.sh"
exit
1
fi
# ex: ts=2 sw=2 et filetype=sh
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment