This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch release-1.8.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/release-1.8.x by this push:
new 2ac771ee4 chore: update docs script
2ac771ee4 is described below
commit 2ac771ee42963bd5b3c1e890b7f155c2d1141ccf
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Wed Dec 21 12:12:53 2022 +0100
chore: update docs script
---
docs/antora.yml | 17 ++++++---
script/update_docs.sh | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 111 insertions(+), 6 deletions(-)
diff --git a/docs/antora.yml b/docs/antora.yml
index f9fb0f2e3..2ccdaf3c9 100644
--- a/docs/antora.yml
+++ b/docs/antora.yml
@@ -16,15 +16,13 @@
#
# Another part of this distributed component is in camel-k-runtime docs
-
name: camel-k
title: Camel K
version: 1.8.x
nav:
-- modules/ROOT/nav.adoc
-- modules/languages/nav-languages.adoc
-- modules/ROOT/nav-end.adoc
-
+ - modules/ROOT/nav.adoc
+ - modules/languages/nav-languages.adoc
+ - modules/ROOT/nav-end.adoc
# On release, update this to the appropriate released camel version.
asciidoc:
attributes:
@@ -42,4 +40,11 @@ asciidoc:
quarkus-version: 2.7.0.Final
graalvm-version: 21.3.0
graalvm-docs-version: 21.3
-
+ buildah-version: 1.14.0
+ kaniko-version: 0.17.1
+ kustomize-version: 4.1.2
+ kubernetes-api-version: 0.21.4
+ operator-fwk-api-version: 0.3.8
+ knative-api-version: 0.28.0
+ service-binding-op-version: 1.0.0
+ prometheus-op-version: 0.42.1
diff --git a/script/update_docs.sh b/script/update_docs.sh
new file mode 100755
index 000000000..15758f385
--- /dev/null
+++ b/script/update_docs.sh
@@ -0,0 +1,100 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+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
+ echo "❗ argument must match semantic version: $KAMELETS_VERSION"
+ 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
+
+echo "Scraping information from catalog available at: $CATALOG"
+RUNTIME_VERSION=$(yq '.spec.runtime.version' $CATALOG)
+CAMEL_VERSION=$(yq '.spec.runtime.metadata."camel.version"' $CATALOG)
+re="^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$"
+if ! [[ $CAMEL_VERSION =~ $re ]]; then
+ echo "❗ argument must match semantic version: $CAMEL_VERSION"
+ exit 1
+fi
+CAMEL_DOCS_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x"
+CAMEL_QUARKUS_VERSION=$(yq '.spec.runtime.metadata."camel-quarkus.version"'
$CATALOG)
+re="^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$"
+if ! [[ $CAMEL_QUARKUS_VERSION =~ $re ]]; then
+ echo "❗ argument must match semantic version: $CAMEL_QUARKUS_VERSION"
+ exit 1
+fi
+CAMEL_QUARKUS_DOCS_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x"
+QUARKUS_VERSION=$(yq '.spec.runtime.metadata."quarkus.version"' $CATALOG)
+
+echo "Camel K Runtime version: $RUNTIME_VERSION"
+echo "Camel version: $CAMEL_VERSION"
+echo "Camel Quarkus version: $CAMEL_QUARKUS_VERSION"
+echo "Quarkus version: $QUARKUS_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
+yq -i ".asciidoc.attributes.camel-docs-version = \"$CAMEL_DOCS_VERSION\""
$location/../docs/antora.yml
+yq -i ".asciidoc.attributes.camel-quarkus-version =
\"$CAMEL_QUARKUS_VERSION\"" $location/../docs/antora.yml
+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
+
+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