Skip to content

Commit

Permalink
Merge pull request #114 from SystemCraftsman/task/bump-version
Browse files Browse the repository at this point in the history
Bump version & build/deploy steps updates
  • Loading branch information
mabulgu committed Oct 17, 2023
2 parents 190390d + 4517e37 commit 741ad40
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 41 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Setup an environment for Python ${{ matrix.python-version }}
run: pip install ".[dev]"
- name: Install dependencies
run: make install-dependencies

- name: Lint with flake8
run: |
Expand All @@ -41,8 +41,6 @@ jobs:
- name: Test
run: |
kfk
cd tests && pytest
make test
- name: Build
run: |
python -m build
twine check --strict dist/*
run: make build
18 changes: 11 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,28 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Get release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Get code version
run: echo "STRIMZI_CLI_VERSION=$(grep 'version' setup.cfg | cut -d '=' -f 2 | xargs)" >> $GITHUB_ENV
run: echo "STRIMZI_CLI_VERSION=$(grep -m 1 'version' pyproject.toml | cut -d '=' -f 2 | xargs)" >> $GITHUB_ENV

- name: Compare release and code version
if: ${{ env.RELEASE_VERSION != env.STRIMZI_CLI_VERSION }}
run: exit 1

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
run: make install-dependencies

- name: Build
run: |
python setup.py sdist bdist_wheel
run: make build

- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3-alpine
USER root
RUN adduser -D kfkuser
RUN pip install strimzi-kafka-cli==0.1.0a68
RUN pip install strimzi-kafka-cli==0.1.0a69
USER kfkuser
RUN kfk --version
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SHELL := /bin/bash

PYPI_USER=
PYPI_SERVER=

Expand All @@ -13,7 +15,10 @@ lint:
python -m flake8

test:
python -m pytest -x
pushd tests; python -m pytest -x; popd

build: clean
python setup.py sdist bdist_wheel
python -m build; twine check --strict dist/*

install-dependencies:
pip install ".[dev]"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Build](https://github.com/systemcraftsman/strimzi-kafka-cli/workflows/Build/badge.svg) ![Deploy](https://github.com/systemcraftsman/strimzi-kafka-cli/workflows/Deploy/badge.svg) [![PyPI](https://img.shields.io/pypi/v/strimzi-kafka-cli)](https://pypi.org/project/strimzi-kafka-cli/) [![Downloads](https://static.pepy.tech/badge/strimzi-kafka-cli)](https://pepy.tech/project/strimzi-kafka-cli) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![Strimzi](https://img.shields.io/badge/Strimzi-0.35.1-blue)](https://github.com/strimzi/strimzi-kafka-operator/releases) [![AMQ Streams](https://img.shields.io/badge/AMQ Streams-2.4.0-red)](https://access.redhat.com/documentation/en-us/red_hat_amq_streams/2.4)
![Build](https://github.com/systemcraftsman/strimzi-kafka-cli/workflows/Build/badge.svg) ![Deploy](https://github.com/systemcraftsman/strimzi-kafka-cli/workflows/Deploy/badge.svg) [![PyPI](https://img.shields.io/pypi/v/strimzi-kafka-cli)](https://pypi.org/project/strimzi-kafka-cli/) [![Downloads](https://static.pepy.tech/badge/strimzi-kafka-cli)](https://pepy.tech/project/strimzi-kafka-cli) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![Strimzi](https://img.shields.io/badge/Strimzi-0.36.1-blue)](https://github.com/strimzi/strimzi-kafka-operator/releases/tag/0.36.1) [![AMQ Streams](https://img.shields.io/badge/AMQ Streams-2.5.0-red)](https://access.redhat.com/documentation/en-us/red_hat_amq_streams/2.5)

![Strimzi CLI logo](https://github.com/SystemCraftsman/strimzi-kafka-cli/assets/10568159/596ea147-9594-4262-a0c3-d63fa14f0577)

Expand Down Expand Up @@ -65,7 +65,7 @@ brew install strimzi-kafka-cli

> Installing the CLI by using Homebrew already uses a virtual environment, so you don't have to worry about your main Python environment.
Project requires: Python >=3.7
Project requires: Python >=3.8

## Examples

Expand Down
2 changes: 1 addition & 1 deletion kfk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pathlib import Path

STRIMZI_VERSION = "0.35.1"
STRIMZI_VERSION = "0.36.1"
KUBECTL_VERSION = "v1.26.1"


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "strimzi-kafka-cli"
version = "0.1.0-alpha68"
version = "0.1.0-alpha69"
description = "Command Line Interface for Strimzi Kafka Operator"
authors = [{ name = "Aykut Bulgu", email = "aykut@systemcraftsman.com" }]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion tests/files/yaml/kafka-connect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ spec:
value.converter: org.apache.kafka.connect.json.JsonConverter
value.converter.schemas.enable: true
replicas: 1
version: 3.4.0
version: 3.5.1
2 changes: 1 addition & 1 deletion tests/files/yaml/kafka-connect_with_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ spec:
value.converter.schemas.enable: true
image: quay.io/systemcraftsman/test-connect-cluster:latest
replicas: 1
version: 3.4.0
version: 3.5.1
2 changes: 1 addition & 1 deletion tests/files/yaml/kafka-connect_with_three_replicas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ spec:
value.converter: org.apache.kafka.connect.json.JsonConverter
value.converter.schemas.enable: true
replicas: 3
version: 3.4.0
version: 3.5.1
2 changes: 1 addition & 1 deletion tests/files/yaml/kafka-connect_with_zip_jar_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ spec:
value.converter: org.apache.kafka.connect.json.JsonConverter
value.converter.schemas.enable: true
replicas: 1
version: 3.4.0
version: 3.5.1
4 changes: 2 additions & 2 deletions tests/files/yaml/kafka-ephemeral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: my-cluster
spec:
kafka:
version: 3.4.0
version: 3.5.1
replicas: 3
listeners:
- name: plain
Expand All @@ -20,7 +20,7 @@ spec:
transaction.state.log.replication.factor: 3
transaction.state.log.min.isr: 2
default.replication.factor: 3
inter.broker.protocol.version: "3.4"
inter.broker.protocol.version: "3.5"
min.insync.replicas: 2
storage:
type: ephemeral
Expand Down
4 changes: 2 additions & 2 deletions tests/files/yaml/kafka-ephemeral_name_updated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
kafka:
config:
default.replication.factor: 3
inter.broker.protocol.version: '3.4'
inter.broker.protocol.version: '3.5'
min.insync.replicas: 2
offsets.topic.replication.factor: 3
transaction.state.log.min.isr: 2
Expand All @@ -26,7 +26,7 @@ spec:
replicas: 3
storage:
type: ephemeral
version: 3.4.0
version: 3.5.1
zookeeper:
replicas: 3
storage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
kafka:
config:
default.replication.factor: 3
inter.broker.protocol.version: '3.4'
inter.broker.protocol.version: '3.5'
min.insync.replicas: 2
offsets.topic.replication.factor: 3
transaction.state.log.min.isr: 2
Expand All @@ -26,7 +26,7 @@ spec:
replicas: 3
storage:
type: ephemeral
version: 3.4.0
version: 3.5.1
zookeeper:
replicas: 3
storage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
kafka:
config:
default.replication.factor: 3
inter.broker.protocol.version: '3.4'
inter.broker.protocol.version: '3.5'
min.insync.replicas: 2
offsets.topic.replication.factor: 3
transaction.state.log.min.isr: 2
Expand All @@ -27,7 +27,7 @@ spec:
replicas: 3
storage:
type: ephemeral
version: 3.4.0
version: 3.5.1
zookeeper:
replicas: 3
storage:
Expand Down
4 changes: 2 additions & 2 deletions tests/files/yaml/kafka-ephemeral_with_one_replica.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
kafka:
config:
default.replication.factor: 1
inter.broker.protocol.version: '3.4'
inter.broker.protocol.version: '3.5'
min.insync.replicas: 1
offsets.topic.replication.factor: 1
transaction.state.log.min.isr: 1
Expand All @@ -26,7 +26,7 @@ spec:
replicas: 1
storage:
type: ephemeral
version: 3.4.0
version: 3.5.1
zookeeper:
replicas: 3
storage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
kafka:
config:
default.replication.factor: 1
inter.broker.protocol.version: '3.4'
inter.broker.protocol.version: '3.5'
min.insync.replicas: 1
offsets.topic.replication.factor: 1
transaction.state.log.min.isr: 1
Expand All @@ -26,7 +26,7 @@ spec:
replicas: 1
storage:
type: ephemeral
version: 3.4.0
version: 3.5.1
zookeeper:
replicas: 1
storage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
kafka:
config:
default.replication.factor: 3
inter.broker.protocol.version: '3.4'
inter.broker.protocol.version: '3.5'
log.retention.hours: 168
min.insync.replicas: 2
offsets.topic.replication.factor: 3
Expand All @@ -28,7 +28,7 @@ spec:
replicas: 3
storage:
type: ephemeral
version: 3.4.0
version: 3.5.1
zookeeper:
replicas: 3
storage:
Expand Down
4 changes: 2 additions & 2 deletions tests/files/yaml/kafka-ephemeral_with_two_replicas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
kafka:
config:
default.replication.factor: 2
inter.broker.protocol.version: '3.4'
inter.broker.protocol.version: '3.5'
min.insync.replicas: 1
offsets.topic.replication.factor: 2
transaction.state.log.min.isr: 1
Expand All @@ -26,7 +26,7 @@ spec:
replicas: 2
storage:
type: ephemeral
version: 3.4.0
version: 3.5.1
zookeeper:
replicas: 3
storage:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_operator_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def setUp(self):
self.runner = CliRunner()
self.cluster = "my-cluster"
self.namespace = "kafka"
self.installation_file_count = 27
self.installation_file_count = 28

@mock.patch('kfk.commands.operator.os.system')
def test_install_strimzi(self, mock_os_system):
Expand Down

0 comments on commit 741ad40

Please sign in to comment.