mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
update the source code
This commit is contained in:
parent
a6634adc1c
commit
a3cbf49ea4
@ -12,6 +12,6 @@ COPY gen-swagger-docs.sh build/
|
|||||||
|
|
||||||
#run the script once to download the dependent java libraries into the image
|
#run the script once to download the dependent java libraries into the image
|
||||||
RUN mkdir /output
|
RUN mkdir /output
|
||||||
RUN build/gen-swagger-docs.sh https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes/master/api/swagger-spec/v1.json https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes/master/pkg/api/v1/register.go
|
RUN build/gen-swagger-docs.sh v1 https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes/master/api/swagger-spec/v1.json https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes/master/pkg/api/v1/register.go
|
||||||
|
|
||||||
ENTRYPOINT ["build/gen-swagger-docs.sh"]
|
ENTRYPOINT ["build/gen-swagger-docs.sh"]
|
||||||
|
@ -20,13 +20,10 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
echo $1
|
|
||||||
echo $2
|
|
||||||
|
|
||||||
cd /build/
|
cd /build/
|
||||||
|
|
||||||
wget "$1" -O input.json
|
wget "$2" -O input.json
|
||||||
wget "$2" -O register.go
|
wget "$3" -O register.go
|
||||||
|
|
||||||
./gradle-2.5/bin/gradle gendocs --info
|
./gradle-2.5/bin/gradle gendocs --info
|
||||||
|
|
||||||
@ -36,9 +33,9 @@ top_level_models=$(grep IsAnAPIObject ./register.go | sed 's/func (\*\(.*\)) IsA
|
|||||||
| tr -d '()' | tr -d '{}' | tr -d ' ')
|
| tr -d '()' | tr -d '{}' | tr -d ' ')
|
||||||
for m in $top_level_models
|
for m in $top_level_models
|
||||||
do
|
do
|
||||||
if grep -xq "=== v1.$m" ./definitions.adoc
|
if grep -xq "=== $1.$m" ./definitions.adoc
|
||||||
then
|
then
|
||||||
buf+="* <<v1."$m">>\n"
|
buf+="* <<$1."$m">>\n"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
sed -i "1i $buf" ./definitions.adoc
|
sed -i "1i $buf" ./definitions.adoc
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2014 The Kubernetes Authors All rights reserved.
|
# Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@ -14,10 +14,22 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
if [ "$#" -lt 1 ]; then
|
set -o errexit
|
||||||
echo "Usage: run-gen-swagger-docs.sh <API version> <absolute output path, default to PWD>"
|
set -o nounset
|
||||||
exit
|
set -o pipefail
|
||||||
fi
|
|
||||||
OUTPUT=${2:-${PWD}}
|
|
||||||
|
|
||||||
docker run -v ${OUTPUT}:/output gcr.io/google_containers/gen-swagger-docs:v1.1 https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/swagger-spec/$1.json https://raw.githubusercontent.com/kubernetes/kubernetes/master/pkg/api/$1/register.go
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||||
|
V1_PATH="$PWD/${KUBE_ROOT}/docs/api-reference/v1/"
|
||||||
|
V1BETA1_PATH="$PWD/${KUBE_ROOT}/docs/api-reference/extensions/v1beta1"
|
||||||
|
mkdir -p $V1_PATH
|
||||||
|
mkdir -p $V1BETA1_PATH
|
||||||
|
|
||||||
|
docker run -v $V1_PATH:/output gcr.io/google_containers/gen-swagger-docs:v2 \
|
||||||
|
v1 \
|
||||||
|
https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/swagger-spec/v1.json \
|
||||||
|
https://raw.githubusercontent.com/kubernetes/kubernetes/master/pkg/api/v1/register.go
|
||||||
|
|
||||||
|
docker run -v $V1BETA1_PATH:/output gcr.io/google_containers/gen-swagger-docs:v2 \
|
||||||
|
v1beta1 \
|
||||||
|
https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/swagger-spec/v1beta1.json \
|
||||||
|
https://raw.githubusercontent.com/kubernetes/kubernetes/master/pkg/apis/extensions/v1beta1/register.go
|
||||||
|
Loading…
Reference in New Issue
Block a user