diff --git a/hack/build/config.sh b/hack/build/config.sh index d840600e86..d417940bbc 100755 --- a/hack/build/config.sh +++ b/hack/build/config.sh @@ -29,7 +29,7 @@ FUNC_TEST_PROXY="cdi-func-test-proxy" FUNC_TEST_POPULATOR="cdi-func-test-sample-populator" # update this whenever new builder tag is created -BUILDER_IMAGE=${BUILDER_IMAGE:-quay.io/kubevirt/kubevirt-cdi-bazel-builder:2408131802-67ef11da7} +BUILDER_IMAGE=${BUILDER_IMAGE:-quay.io/kubevirt/kubevirt-cdi-bazel-builder:2408160841-626901083} BINARIES="cmd/${OPERATOR} cmd/${CONTROLLER} cmd/${IMPORTER} cmd/${CLONER} cmd/${APISERVER} cmd/${UPLOADPROXY} cmd/${UPLOADSERVER} cmd/${OPERATOR} tools/${FUNC_TEST_INIT} tools/${FUNC_TEST_REGISTRY_INIT} tools/${FUNC_TEST_BAD_WEBSERVER} tools/${FUNC_TEST_PROXY} tools/${FUNC_TEST_POPULATOR}" CDI_PKGS="cmd/ pkg/ test/" diff --git a/hack/gen-swagger-doc/build.gradle b/hack/gen-swagger-doc/build.gradle deleted file mode 100644 index 1882f5cf45..0000000000 --- a/hack/gen-swagger-doc/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -buildscript { - repositories { - mavenLocal() - mavenCentral() - google() - jcenter() - } - - dependencies { - classpath "io.github.swagger2markup:swagger2markup-gradle-plugin:1.3.3" - classpath "org.asciidoctor:asciidoctor-gradle-plugin:1.5.6" - } -} - -apply plugin: 'io.github.swagger2markup' - -convertSwagger2markup { - swaggerInput file("../../api/openapi-spec/swagger.json").getAbsolutePath() - outputDir file("./") - config = [ - 'swagger2markup.markupLanguage': markupLanguage, - 'swagger2markup.interDocumentCrossReferencesEnabled': true, - ] -} - -apply plugin: 'org.asciidoctor.convert' - -asciidoctor { - sourceDir = file('./') - sources { - // paths.adoc is being renamed to operations.adoc by gen-swagger-docs.sh. - // Keeping it here in case somebody run: gradle convertSwagger2markup asciidoctor - include 'definitions.adoc', 'overview.adoc', 'paths.adoc', 'security.adoc', 'operations.adoc' - } - outputDir = file('./') - attributes 'toc' : 'right' -} diff --git a/hack/gen-swagger-doc/gen-swagger-docs.sh b/hack/gen-swagger-doc/gen-swagger-docs.sh index eea3e05802..aa6cd901ac 100755 --- a/hack/gen-swagger-doc/gen-swagger-docs.sh +++ b/hack/gen-swagger-doc/gen-swagger-docs.sh @@ -22,23 +22,21 @@ if [ "$OUTPUT_FORMAT" = "html" ]; then LINK1_TEMPLATE="\* \<\<\${VERSION}.\$m\>\>" LINK_DEFINITIONS="* link:./definitions.html[Types Definition]" LINK_OPERATIONS="* link:./operations.html[Operations]" - GRADLE_EXTRA_PARAMS="" elif [ "$OUTPUT_FORMAT" = "markdown" ]; then SUFFIX="md" HEADER="#" LINK1_TEMPLATE="\* [\${VERSION}.\$m]\(definitions.md#\${VERSION}-\${m,,}\)" LINK_DEFINITIONS="* [Types Definition](definitions.md)" LINK_OPERATIONS="* [Operations](operations.md)" - GRADLE_EXTRA_PARAMS="-PmarkupLanguage=MARKDOWN" else echo "Unknown OUTPUT_FORMAT=${OUTPUT_FORMAT}" exit 1 fi WORKDIR="hack/gen-swagger-doc" -GRADLE_BUILD_FILE="$WORKDIR/build.gradle" +SWAGGER_JSON="api/openapi-spec/swagger.json" # Generate *.adoc files from swagger.json -gradle -b $GRADLE_BUILD_FILE $GRADLE_EXTRA_PARAMS convertSwagger2markup --info --stacktrace +java -jar /opt/swagger2markup-cli/swagger2markup-cli-1.3.3.jar convert -i $SWAGGER_JSON -d $WORKDIR/ #insert a TOC for top level API objects buf="${HEADER}${HEADER} Top Level API Objects\n\n" @@ -86,7 +84,16 @@ if [ "$OUTPUT_FORMAT" = "html" ]; then "$WORKDIR/overview.adoc" # Generate *.html files from *.adoc - gradle -b $GRADLE_BUILD_FILE asciidoctor --info + rm -rf "$WORKDIR/html5" && mkdir -p "$WORKDIR/html5" + adoc_files=("definitions.adoc" "overview.adoc" "security.adoc" "operations.adoc") + for html_file in ${adoc_files[@]}; do + asciidoctor \ + --failure-level INFO \ + --attribute toc=right \ + --destination-dir $WORKDIR/html5 \ + $PWD/$WORKDIR/$html_file + done + rm -rf "$WORKDIR/html5/content" && mkdir "$WORKDIR/html5/content" && mv -f "$WORKDIR/html5/"*.html "$WORKDIR/html5/content" mv -f "$WORKDIR/html5/content/overview.html" "$WORKDIR/html5/content/index.html" elif [ "$OUTPUT_FORMAT" = "markdown" ]; then diff --git a/hack/gen-swagger-doc/gradle.properties b/hack/gen-swagger-doc/gradle.properties deleted file mode 100644 index 284894e36d..0000000000 --- a/hack/gen-swagger-doc/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -markupLanguage=ASCIIDOC