-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.ps1
27 lines (23 loc) · 1.34 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# This script uses openapi2jsonschema to generate a set of JSON schemas for
# the specified Kubernetes versions in three different flavours:
#
# X.Y.Z - URL referenced based on the specified GitHub repository
# X.Y.Z-standalone - de-referenced schemas, more useful as standalone documents
# X.Y.Z-local - relative references, useful to avoid the network dependency
$repo="garethr/openshift-json-schema"
$arr = @("master",
"v3.6.0",
"v1.5.1",
"v1.5.0")
foreach($version in $arr) {
$schema="https://raw.githubusercontent.com/openshift/origin/${version}/api/swagger-spec/openshift-openapi-spec.json"
$prefix="https://raw.githubusercontent.com/${repo}/master/${version}/_definitions.json"
docker run --rm -v ${PWD}:/out garethr/openapi2jsonschema -o "$version-standalone-strict" --kubernetes --stand-alone --strict "$schema"
docker run --rm -v ${PWD}:/out garethr/openapi2jsonschema -o "$version-standalone" --kubernetes --stand-alone "$schema"
docker run --rm -v ${PWD}:/out garethr/openapi2jsonschema -o "$version-local" --kubernetes "$schema"
docker run --rm -v ${PWD}:/out garethr/openapi2jsonschema -o "$version" --kubernetes --prefix "$prefix" "$schema"
dos2unix.exe "$version-standalone-strict/*"
dos2unix.exe "$version-standalone/*"
dos2unix.exe "$version-local/*"
dos2unix.exe "$version/*"
}