From 29d3d4906194c4c2607ebecd35d7148b81dfe25f Mon Sep 17 00:00:00 2001 From: Tom Bentley Date: Tue, 18 Jun 2019 12:54:14 +0100 Subject: [PATCH] Use templating for versions (#74) * Use templating for versions --- _data/releases.yaml | 25 +++++++++++++++++++++++++ documentation/archive/index.md | 30 +++++++++++------------------- documentation/index.md | 4 ++-- downloads/archive/index.md | 26 ++++++-------------------- downloads/index.md | 4 ++-- index.md | 8 ++++---- quickstarts/minikube/index.md | 8 ++++---- quickstarts/okd/index.md | 8 ++++---- 8 files changed, 58 insertions(+), 55 deletions(-) create mode 100644 _data/releases.yaml diff --git a/_data/releases.yaml b/_data/releases.yaml new file mode 100644 index 000000000..c662ee470 --- /dev/null +++ b/_data/releases.yaml @@ -0,0 +1,25 @@ +operator: + - version: 0.12.0 + defaultKafkaVersion: 2.2.1 + - version: 0.11.4 + defaultKafkaVersion: 2.1.1 + - version: 0.11.3 + - version: 0.11.2 + - version: 0.11.1 + - version: 0.11.0 + - version: 0.10.0 + - version: 0.9.0 + - version: 0.8.2 + - version: 0.8.1 + - version: 0.8.0 + - version: 0.7.0 + - version: 0.6.0 + - version: 0.5.0 + - version: 0.4.0 + - version: 0.3.1 + - version: 0.3.0 + - version: 0.2.0 + - version: 0.1.0 +bridge: + - version: 0.12.0 + diff --git a/documentation/archive/index.md b/documentation/archive/index.md index 383c62cf2..6d52ac5b3 100644 --- a/documentation/archive/index.md +++ b/documentation/archive/index.md @@ -6,26 +6,18 @@ layout: default ## Strimzi Kafka operators -* [0.12.0](/docs/0.12.0/) -* [0.11.4](/docs/0.11.4/) -* [0.11.3](/docs/0.11.3/) -* [0.11.2](/docs/0.11.2/) -* [0.11.1](/docs/0.11.1/) -* [0.11.0](/docs/0.11.0/) -* [0.10.0](/docs/0.10.0/) -* [0.9.0](/docs/0.9.0/) -* [0.8.2](/docs/0.8.2/) -* [0.8.1](/docs/0.8.1/) -* [0.8.0](/docs/0.8.0/) -* [0.7.0](/docs/0.7.0/) -* [0.6.0](/docs/0.6.0/) -* [0.5.0](/docs/0.5.0/) -* [0.4.0](/docs/0.4.0/) -* [0.3.1](/docs/0.3.1/) -* [0.3.0](/docs/0.3.0/) -* [0.2.0](/docs/0.2.0/) +{% for item in site.data.releases.operator -%} +{% if item.version != "0.1.0" -%} +* [{{item.version}}](/docs/{{item.version}}/) +{% else -%} * [0.1.0](/docs/0.1.0/README.md) +{% endif -%} +{% endfor -%} + + ## Strimzi Kafka bridge -* [0.12.0](/docs/bridge/0.12.0/) \ No newline at end of file +{% for item in site.data.releases.bridge -%} +* [{{item.version}}](/docs/{{item.version}}/) +{% endfor -%} \ No newline at end of file diff --git a/documentation/index.md b/documentation/index.md index 9d345326b..38a543b69 100644 --- a/documentation/index.md +++ b/documentation/index.md @@ -6,12 +6,12 @@ layout: default ## Strimzi Kafka operators -* [0.12.0 - Latest stable release](/docs/latest/) +* [{{site.data.releases.operator[0].version}} - latest stable release](/docs/latest/) * [Master](/docs/master/) ## Strimzi Kafka bridge -* [0.12.0 - Latest stable release](/docs/bridge/latest/) +* [{{site.data.releases.bridge[0].version}} - latest stable release](/docs/bridge/latest/) * [Master](/docs/bridge/master/) ## Documentation Archive diff --git a/downloads/archive/index.md b/downloads/archive/index.md index 48e15bdca..0429b0067 100644 --- a/downloads/archive/index.md +++ b/downloads/archive/index.md @@ -6,26 +6,12 @@ layout: default ## Strimzi Kafka operators -* [0.12.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.12.0) -* [0.11.4](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.11.4) -* [0.11.3](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.11.3) -* [0.11.2](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.11.2) -* [0.11.1](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.11.1) -* [0.11.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.11.0) -* [0.10.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.10.0) -* [0.9.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.9.0) -* [0.8.2](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.8.2) -* [0.8.1](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.8.1) -* [0.8.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.8.0) -* [0.7.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.7.0) -* [0.6.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.6.0) -* [0.5.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.5.0) -* [0.4.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.4.0) -* [0.3.1](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.3.1) -* [0.3.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.3.0) -* [0.2.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.2.0) -* [0.1.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.1.0) +{% for item in site.data.releases.operator -%} +* [{{item.version}}](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/{{item.version}}) +{% endfor -%} ## Strimzi Kafka bridge -* [0.12.0](https://github.com/strimzi/strimzi-kafka-bridge/releases/tag/0.12.0) \ No newline at end of file +{% for item in site.data.releases.bridge -%} +* [{{item.version}}](https://github.com/strimzi/strimzi-kafka-bridge/releases/tag/{{item.version}}) +{% endfor -%} diff --git a/downloads/index.md b/downloads/index.md index 8e45d82d8..763a15a55 100644 --- a/downloads/index.md +++ b/downloads/index.md @@ -11,11 +11,11 @@ available on [Docker Hub](https://hub.docker.com/u/strimzi/). ## Strimzi Kafka operators -* [Latest stable release - 0.12.0](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.12.0) +* [{{site.data.releases.operator[0].version}} – latest stable release](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/{{site.data.releases.operator[0].version}}) ## Strimzi Kafka bridge -* [Latest stable release - 0.12.0](https://github.com/strimzi/strimzi-kafka-bridge/releases/tag/0.12.0) +* [{{site.data.releases.bridge[0].version}} – latest stable release](https://github.com/strimzi/strimzi-kafka-bridge/releases/tag/{{site.data.releases.bridge[0].version}}) ## Downloads Archive diff --git a/index.md b/index.md index 927eedb69..af8bc94ef 100644 --- a/index.md +++ b/index.md @@ -26,15 +26,15 @@ Strimzi releases are available for download on our [GitHub](https://github.com/s contain documentation and example YAML files for deployment on OpenShift and Kubernetes. The Docker images are available on [Docker Hub](https://hub.docker.com/u/strimzi/). -* [Strimzi Kafka operators - latest stable version (0.12.0)](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.12.0) -* [Strimzi Kafka bridge - Latest stable release (0.12.0)](https://github.com/strimzi/strimzi-kafka-bridge/releases/tag/0.12.0) +* [Strimzi Kafka operators - latest stable version ({{site.data.releases.operator[0].version}})](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/{{site.data.releases.operator[0].version}}) +* [Strimzi Kafka bridge - latest stable release ({{site.data.releases.bridge[0].version}})](https://github.com/strimzi/strimzi-kafka-bridge/releases/tag/{{site.data.releases.bridge[0].version}}) All releases can be found in the [Downloads](/downloads) page. # Documentation -* [Strimzi Kafka operators - latest stable version (0.12.0)](/docs/latest/) -* [Strimzi Kafka bridge - latest stable version (0.12.0)](/docs/bridge/latest/) +* [Strimzi Kafka operators - latest stable version ({{site.data.releases.operator[0].version}})](/docs/latest/) +* [Strimzi Kafka bridge - latest stable version ({{site.data.releases.bridge[0].version}})](/docs/bridge/latest/) Documentation for all releases can be found in the [Documentation](/documentation) page. diff --git a/quickstarts/minikube/index.md b/quickstarts/minikube/index.md index 7a0a6717b..e4c2886e0 100644 --- a/quickstarts/minikube/index.md +++ b/quickstarts/minikube/index.md @@ -23,7 +23,7 @@ kubectl create namespace kafka Next we apply the Strimzi install files, including `ClusterRoles`, `ClusterRoleBindings` and some **Custom Resource Definitions** (`CRDs`). The CRDs define the schemas used for declarative management of the Kafka cluster, Kafka topics and users. ```shell -curl -L https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.12.0/strimzi-cluster-operator-0.12.0.yaml \ +curl -L https://github.com/strimzi/strimzi-kafka-operator/releases/download/{{site.data.releases.operator[0].version}}/strimzi-cluster-operator-{{site.data.releases.operator[0].version}}.yaml \ | sed 's/namespace: .*/namespace: kafka/' \ | kubectl -n kafka apply -f - ``` @@ -34,7 +34,7 @@ After that we feed Strimzi with a simple **Custom Resource**, which will than gi ```shell # Apply the `Kafka` Cluster CR file -kubectl apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/0.12.0/examples/kafka/kafka-persistent-single.yaml -n kafka +kubectl apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/{{site.data.releases.operator[0].version}}/examples/kafka/kafka-persistent-single.yaml -n kafka ``` We can now watch the deployment on the `kafka` namespace, and see all required pods being created: @@ -57,13 +57,13 @@ strimzi-cluster-operator-78f8bf857-kpmhb 1/1 Running 0 3m10s Once the cluster is running, you can run a simple producer to send messages to Kafka topic (the topic will be automatically created): ```shell -kubectl -n kafka run kafka-producer -ti --image=strimzi/kafka:0.12.0-kafka-2.1.0 --rm=true --restart=Never -- bin/kafka-console-producer.sh --broker-list my-cluster-kafka-bootstrap:9092 --topic my-topic +kubectl -n kafka run kafka-producer -ti --image=strimzi/kafka{{site.data.releases.operator[0].version}}-kafka-{{site.data.releases.operator[0].defaultKafkaVersion}} --rm=true --restart=Never -- bin/kafka-console-producer.sh --broker-list my-cluster-kafka-bootstrap:9092 --topic my-topic ``` And to receive them: ```shell -kubectl -n kafka run kafka-consumer -ti --image=strimzi/kafka:0.12.0-kafka-2.1.0 --rm=true --restart=Never -- bin/kafka-console-consumer.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --topic my-topic --from-beginning +kubectl -n kafka run kafka-consumer -ti --image=strimzi/kafka:{{site.data.releases.operator[0].version}}-kafka-{{site.data.releases.operator[0].defaultKafkaVersion}} --rm=true --restart=Never -- bin/kafka-console-consumer.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --topic my-topic --from-beginning ``` Enjoy your Apache Kafka cluster, running on Minikube! diff --git a/quickstarts/okd/index.md b/quickstarts/okd/index.md index 585405e6f..e5b836aab 100644 --- a/quickstarts/okd/index.md +++ b/quickstarts/okd/index.md @@ -22,7 +22,7 @@ oc login -u system:admin Next we apply the Strimzi install files, including `ClusterRoles`, `ClusterRoleBindings` and some **Custom Resource Definitions** (`CRDs`). The CRDs define the schemas used for declarative management of the Kafka cluster, Kafka topics and users. ```shell -oc apply -f https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.12.0/strimzi-cluster-operator-0.12.0.yaml -n myproject +oc apply -f https://github.com/strimzi/strimzi-kafka-operator/releases/download/{{site.data.releases.operator[0].version}}/strimzi-cluster-operator-{{site.data.releases.operator[0].version}}.yaml -n myproject ``` # Provision the Apache Kafka cluster @@ -31,7 +31,7 @@ After that we feed Strimzi with a simple **Custom Resource**, which will than gi ```shell # Apply the `Kafka` Cluster CR file -oc apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/0.12.0/examples/kafka/kafka-persistent-single.yaml -n myproject +oc apply -f https://raw.githubusercontent.com/strimzi/strimzi-kafka-operator/{{site.data.releases.operator[0].version}}/examples/kafka/kafka-persistent-single.yaml -n myproject ``` We can now watch the deployment on the `myproject` namesapce, and see all required pods being created: @@ -54,13 +54,13 @@ strimzi-cluster-operator-78f8bf857-kpmhb 1/1 Running 0 3m10s Once the cluster is running, you can run a simple producer to send messages to Kafka topic (the topic will be automatically created): ```shell -oc run kafka-producer -ti --image=strimzi/kafka:0.12.0-kafka-2.1.0 --rm=true --restart=Never -- bin/kafka-console-producer.sh --broker-list my-cluster-kafka-bootstrap:9092 --topic my-topic +oc run kafka-producer -ti --image=strimzi/kafka:{{site.data.releases.operator[0].version}}-kafka-{{site.data.releases.operator[0].defaultKafkaVersion}} --rm=true --restart=Never -- bin/kafka-console-producer.sh --broker-list my-cluster-kafka-bootstrap:9092 --topic my-topic ``` And to receive them: ```shell -oc run kafka-consumer -ti --image=strimzi/kafka:0.12.0-kafka-2.1.0 --rm=true --restart=Never -- bin/kafka-console-consumer.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --topic my-topic --from-beginning +oc run kafka-consumer -ti --image=strimzi/kafka:{{site.data.releases.operator[0].version}}-kafka-{{site.data.releases.operator[0].defaultKafkaVersion}} --rm=true --restart=Never -- bin/kafka-console-consumer.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --topic my-topic --from-beginning ``` Enjoy your Apache Kafka cluster, running on OKD!