You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2022/12/19 08:51:18 UTC

[camel-k] branch main updated: feat(doc): automatic version scraping

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/main by this push:
     new ec6beb5df feat(doc): automatic version scraping
ec6beb5df is described below

commit ec6beb5dfab20503e4ceb97d7e00bb7989656d24
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Fri Dec 16 15:53:48 2022 +0100

    feat(doc): automatic version scraping
    
    Scrape makefile, camel-catalog and go.mod to retrieve the version of the main dependencies
    
    Close #3306
    Close #3929
---
 docs/antora.yml                    |  8 ++++++
 docs/modules/ROOT/pages/index.adoc | 24 +++++++++++++++---
 script/update_docs.sh              | 51 ++++++++++++++++++++++++++++++++------
 3 files changed, 71 insertions(+), 12 deletions(-)

diff --git a/docs/antora.yml b/docs/antora.yml
index 468473f4e..3226627ec 100644
--- a/docs/antora.yml
+++ b/docs/antora.yml
@@ -39,3 +39,11 @@ asciidoc:
     camel-quarkus-version: 2.14.0
     camel-quarkus-docs-version: 2.14.x
     quarkus-version: 2.14.0.Final
+    buildah-version: 1.23.3
+    kaniko-version: 0.17.1
+    kustomize-version: 4.1.2
+    kubernetes-api-version: 0.23.8
+    operator-fwk-api-version: 0.13.0
+    knative-api-version: 0.33.0
+    service-binding-op-version: 1.3.2
+    prometheus-op-version: 0.50.0
diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc
index 47167b24e..3ffc2b10d 100644
--- a/docs/modules/ROOT/pages/index.adoc
+++ b/docs/modules/ROOT/pages/index.adoc
@@ -4,14 +4,13 @@
 --
 This version ({page-component-display-version}) of {page-component-title} depends on:
 
-* https://github.com/apache/camel-k-runtime.git[camel-k-runtime] (undocumented) at version {camel-k-runtime-version}, and therefore:
+* https://github.com/apache/camel-k-runtime.git[camel-k-runtime] at version {camel-k-runtime-version}, and therefore:
 ** xref:{camel-quarkus-docs-version}@camel-quarkus::index.adoc[] at version {camel-quarkus-version}.
 ** xref:{camel-docs-version}@components::index.adoc[Camel] at version {camel-version}
 ** https://quarkus.io[Quarkus] at version {quarkus-version}
-** https://www.graalvm.org[GraalVM] at version TODO:fix-me graalvm-version
 * xref:{camel-kamelets-docs-version}@camel-kamelets::index.adoc[] at version {camel-kamelets-version}
 
-ifdef::lts[This long term service release will be supported until {lts}.]
+ifdef::lts[This is a long term service release.]
 ifndef::lts[]
 ifdef::prerelease[This is the development version of {page-component-title}. It should not be used in production.]
 ifndef::prerelease[This release will not be updated, but rather replaced by a new release.]
@@ -46,7 +45,7 @@ Continue reading the documentation to xref:installation/installation.adoc[instal
 == Compatibility Matrix
 
 [caption=]
-.Compatibility between Camel K and dependencies
+.Compatibility between Camel K, Camel and Quarkus
 [width="100%",cols="4,2,2,2,2,2,1,3",options="header"]
 |===
 |Camel K Version
@@ -61,3 +60,20 @@ Continue reading the documentation to xref:installation/installation.adoc[instal
 
 //cannot use top level index.adoc as the page with the query is always omitted.
 indexTable::[version="*",relative="running/running.adoc",cellformats="util.ckRef(pageComponentDisplayVersion, pageComponentVersion)|camelKRuntimeVersion|util.camelRef(camelVersion, camelDocsVersion)|util.camelQuarkusRef(camelQuarkusVersion, camelQuarkusDocsVersion)|util.quarkusRef(quarkusVersion)|util.kameletsRef(camelKameletsVersion, camelKameletsDocsVersion)|lts|ck.branch(pageComponentVersion)", requires={requires},transform=util.sortCompatibilityItems]
+
+.Compatibility between Camel K and dependencies
+[width="100%",cols="4,2,2,2,2,2,2,1,3",options="header"]
+|===
+|Camel K Version
+|Kubernetes API
+|Operator Framework API
+|KNative API
+|Service Binding Operator
+|Prometheus Operator
+|Buildah
+|Kaniko
+|Kustomize version
+|===
+
+//cannot use top level index.adoc as the page with the query is always omitted.
+indexTable::[version="*",relative="running/running.adoc",cellformats="util.ckRef(pageComponentDisplayVersion, pageComponentVersion)|kubernetesApiVersion|operatorFwkApiVersion|knativeApiVersion|serviceBindingOpVersion|prometheusOpVersion|buildahVersion|kanikoVersion|kustomizeVersion", requires={requires},transform=util.sortCompatibilityItems]
\ No newline at end of file
diff --git a/script/update_docs.sh b/script/update_docs.sh
index 2444b6004..15758f385 100755
--- a/script/update_docs.sh
+++ b/script/update_docs.sh
@@ -16,7 +16,17 @@
 # limitations under the License.
 
 location=$(dirname $0)
+
+echo "Scraping information from Makefile"
 RUNTIME_VERSION=$(grep '^RUNTIME_VERSION := ' Makefile | sed 's/^.* \?= //')
+
+CATALOG="$location/../resources/camel-catalog-$RUNTIME_VERSION.yaml"
+# This script requires the catalog to be available (via make build-resources for instance)
+if [ ! -f $CATALOG ]; then
+    echo "❗ catalog not available. Make sure to download it before calling this script."
+    exit 1
+fi
+
 KAMELETS_VERSION=$(grep '^KAMELET_CATALOG_REPO_BRANCH := ' Makefile | sed 's/^.* \?= //' | sed 's/^.//')
 re="^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$"
 if ! [[ $KAMELETS_VERSION =~ $re ]]; then
@@ -24,13 +34,20 @@ if ! [[ $KAMELETS_VERSION =~ $re ]]; then
     exit 1
 fi
 KAMELETS_DOCS_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x"
+BUILDAH_VERSION=$(grep '^BUILDAH_VERSION := ' Makefile | sed 's/^.* \?= //')
+KANIKO_VERSION=$(grep '^KANIKO_VERSION := ' Makefile | sed 's/^.* \?= //')
+KUSTOMIZE_VERSION=$(grep '^KUSTOMIZE_VERSION := ' Makefile | sed 's/^.* \?= //' | sed 's/^.//')
+
+echo "Camel K Runtime version: $RUNTIME_VERSION"
+echo "Kamelets version: $KAMELETS_VERSION"
+echo "Buildah version: $BUILDAH_VERSION"
+echo "Kaniko version: $KANIKO_VERSION"
+echo "Kustomize version: $KUSTOMIZE_VERSION"
+
+yq -i ".asciidoc.attributes.buildah-version = \"$BUILDAH_VERSION\"" $location/../docs/antora.yml
+yq -i ".asciidoc.attributes.kaniko-version = \"$KANIKO_VERSION\"" $location/../docs/antora.yml
+yq -i ".asciidoc.attributes.kustomize-version = \"$KUSTOMIZE_VERSION\"" $location/../docs/antora.yml
 
-CATALOG="$location/../resources/camel-catalog-$RUNTIME_VERSION.yaml"
-# This script requires the catalog to be available (via make build-resources for instance)
-if [ ! -f $CATALOG ]; then
-    echo "❗ catalog not available. Make sure to download it before calling this script."
-    exit 1
-fi
 echo "Scraping information from catalog available at: $CATALOG"
 RUNTIME_VERSION=$(yq '.spec.runtime.version' $CATALOG)
 CAMEL_VERSION=$(yq '.spec.runtime.metadata."camel.version"' $CATALOG)
@@ -53,7 +70,6 @@ echo "Camel K Runtime version: $RUNTIME_VERSION"
 echo "Camel version: $CAMEL_VERSION"
 echo "Camel Quarkus version: $CAMEL_QUARKUS_VERSION"
 echo "Quarkus version: $QUARKUS_VERSION"
-echo "Kamelets version: $KAMELETS_VERSION"
 
 yq -i ".asciidoc.attributes.camel-k-runtime-version = \"$RUNTIME_VERSION\"" $location/../docs/antora.yml
 yq -i ".asciidoc.attributes.camel-version = \"$CAMEL_VERSION\"" $location/../docs/antora.yml
@@ -62,4 +78,23 @@ yq -i ".asciidoc.attributes.camel-quarkus-version = \"$CAMEL_QUARKUS_VERSION\""
 yq -i ".asciidoc.attributes.camel-quarkus-docs-version = \"$CAMEL_QUARKUS_DOCS_VERSION\"" $location/../docs/antora.yml
 yq -i ".asciidoc.attributes.quarkus-version = \"$QUARKUS_VERSION\"" $location/../docs/antora.yml
 yq -i ".asciidoc.attributes.camel-kamelets-version = \"$KAMELETS_VERSION\"" $location/../docs/antora.yml
-yq -i ".asciidoc.attributes.camel-kamelets-docs-version = \"$KAMELETS_DOCS_VERSION\"" $location/../docs/antora.yml
\ No newline at end of file
+yq -i ".asciidoc.attributes.camel-kamelets-docs-version = \"$KAMELETS_DOCS_VERSION\"" $location/../docs/antora.yml
+
+echo "Scraping information from go.mod"
+KNATIVE_API_VERSION=$(grep '^.*knative.dev/eventing ' $location/../go.mod | sed 's/^.* //' | sed 's/^.//')
+KUBE_API_VERSION=$(grep '^.*k8s.io/api ' $location/../go.mod | sed 's/^.* //' | sed 's/^.//')
+OPERATOR_FWK_API_VERSION=$(grep '^.*github.com/operator-framework/api ' $location/../go.mod | sed 's/^.* //' | sed 's/^.//')
+SERVICE_BINDING_OP_VERSION=$(grep '^.*github.com/redhat-developer/service-binding-operator ' $location/../go.mod | sed 's/^.* //' | sed 's/^.//')
+PROMETHEUS_OP_VERSION=$(grep '^.*github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring ' $location/../go.mod | sed 's/^.* //' | sed 's/^.//')
+
+echo "Kubernetes API version: $KUBE_API_VERSION"
+echo "Operator Framework API version: $OPERATOR_FWK_API_VERSION"
+echo "KNative API version: $KNATIVE_API_VERSION"
+echo "Service Binding Operator version: $SERVICE_BINDING_OP_VERSION"
+echo "Prometheus Operator version: $PROMETHEUS_OP_VERSION"
+
+yq -i ".asciidoc.attributes.kubernetes-api-version = \"$KUBE_API_VERSION\"" $location/../docs/antora.yml
+yq -i ".asciidoc.attributes.operator-fwk-api-version = \"$OPERATOR_FWK_API_VERSION\"" $location/../docs/antora.yml
+yq -i ".asciidoc.attributes.knative-api-version = \"$KNATIVE_API_VERSION\"" $location/../docs/antora.yml
+yq -i ".asciidoc.attributes.service-binding-op-version = \"$SERVICE_BINDING_OP_VERSION\"" $location/../docs/antora.yml
+yq -i ".asciidoc.attributes.prometheus-op-version = \"$PROMETHEUS_OP_VERSION\"" $location/../docs/antora.yml
\ No newline at end of file