mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
vendor files
This commit is contained in:
45
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/Dockerfile
generated
vendored
Normal file
45
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/Dockerfile
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
# Copyright 2016 The Kubernetes Authors.
|
||||
#
|
||||
# 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.
|
||||
|
||||
FROM java:7-jre
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
asciidoctor \
|
||||
unzip \
|
||||
--no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install gradle
|
||||
RUN wget -O /tmp/gradle.zip https://services.gradle.org/distributions/gradle-2.5-bin.zip \
|
||||
&& mkdir -p build/ \
|
||||
&& unzip /tmp/gradle.zip -d build/ \
|
||||
&& rm /tmp/gradle.zip \
|
||||
&& mkdir -p gradle-cache/
|
||||
|
||||
ENV GRADLE_USER_HOME=/gradle-cache
|
||||
|
||||
COPY build.gradle build/
|
||||
COPY gen-swagger-docs.sh build/
|
||||
|
||||
# Run the script once to download the dependent java libraries into the image
|
||||
RUN mkdir -p /output /swagger-source \
|
||||
&& wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/swagger-spec/v1.json -O /swagger-source/v1.json \
|
||||
&& wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/pkg/api/v1/register.go -O /register.go \
|
||||
&& build/gen-swagger-docs.sh v1 \
|
||||
&& rm -rf /output/* /swagger-source/* /register.go
|
||||
|
||||
RUN chmod -R 777 build/ \
|
||||
&& chmod -R 777 gradle-cache/
|
||||
|
||||
ENTRYPOINT ["build/gen-swagger-docs.sh"]
|
18
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/README.md
generated
vendored
Normal file
18
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/README.md
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
This folder contains the sources needed to build the gen-swagger-doc container.
|
||||
|
||||
To build the container image,
|
||||
|
||||
```
|
||||
$ sudo docker build -t gcr.io/google_containers/gen-swagger-docs:v1 .
|
||||
```
|
||||
|
||||
To generate the html docs,
|
||||
|
||||
```
|
||||
$ ./gen-swagger-docs.sh <API version> <absolute output path, default to PWD>
|
||||
```
|
||||
|
||||
The generated definitions.html and operations.html will be stored in output paths.
|
||||
|
||||
|
||||
[]()
|
18
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/build.gradle
generated
vendored
Normal file
18
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/build.gradle
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'io.github.robwin:swagger2markup:0.6.0'
|
||||
}
|
||||
}
|
||||
|
||||
task gendocs << {
|
||||
io.github.robwin.swagger2markup.Swagger2MarkupConverter
|
||||
.from("./input.json")
|
||||
.build()
|
||||
.intoFolder("./");
|
||||
println '*** generating docs to ./'
|
||||
}
|
5982
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/example-output/definitions.html
generated
vendored
Normal file
5982
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/example-output/definitions.html
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
23842
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/example-output/operations.html
generated
vendored
Normal file
23842
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/example-output/operations.html
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
69
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/gen-swagger-docs.sh
generated
vendored
Executable file
69
vendor/k8s.io/kubernetes/hack/gen-swagger-doc/gen-swagger-docs.sh
generated
vendored
Executable file
@ -0,0 +1,69 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Script to generate docs from the latest swagger spec.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
cd /build
|
||||
|
||||
# gendocs takes "input.json" as the input swagger spec.
|
||||
# $1 is expected to be <group>_<version>
|
||||
cp /swagger-source/"$1".json input.json
|
||||
|
||||
./gradle-2.5/bin/gradle gendocs --info
|
||||
|
||||
#insert a TOC for top level API objects
|
||||
buf="== Top Level API Objects\n\n"
|
||||
top_level_models=$(grep '&[A-Za-z]*{},' /register.go | sed 's/.*&//;s/{},//')
|
||||
|
||||
# check if the top level models exist in the definitions.adoc. If they exist,
|
||||
# their name will be <version>.<model_name>
|
||||
VERSION="${1#*_}"
|
||||
for m in $top_level_models
|
||||
do
|
||||
if grep -xq "=== ${VERSION}.$m" ./definitions.adoc
|
||||
then
|
||||
buf+="* <<${VERSION}.$m>>\n"
|
||||
fi
|
||||
done
|
||||
sed -i "1i $buf" ./definitions.adoc
|
||||
|
||||
# fix the links in .adoc, replace <<x.y>> with link:definitions.html#_x_y[x.y], and lowercase the _x_y part
|
||||
sed -i -e 's|<<\(.*\)\.\(.*\)>>|link:#_\L\1_\2\E[\1.\2]|g' ./definitions.adoc
|
||||
sed -i -e 's|<<\(.*\)\.\(.*\)>>|link:../definitions#_\L\1_\2\E[\1.\2]|g' ./paths.adoc
|
||||
|
||||
# fix the link to <<any>>
|
||||
sed -i -e 's|<<any>>|link:#_any[any]|g' ./definitions.adoc
|
||||
sed -i -e 's|<<any>>|link:../definitions#_any[any]|g' ./paths.adoc
|
||||
|
||||
# change the title of paths.adoc from "paths" to "operations"
|
||||
sed -i 's|== Paths|== Operations|g' ./paths.adoc
|
||||
|
||||
# $$ has special meaning in asciidoc, we need to escape it
|
||||
sed -i 's|\$\$|+++$$+++|g' ./definitions.adoc
|
||||
|
||||
echo -e "=== any\nRepresents an untyped JSON map - see the description of the field for more info about the structure of this object." >> ./definitions.adoc
|
||||
|
||||
asciidoctor definitions.adoc
|
||||
asciidoctor paths.adoc
|
||||
|
||||
cp definitions.html /output/
|
||||
cp paths.html /output/operations.html
|
||||
|
||||
echo "SUCCESS"
|
Reference in New Issue
Block a user