diff --git a/.github/workflows/bump-fluent-bit-version.yaml b/.github/workflows/bump-fluent-bit-version.yaml new file mode 100644 index 000000000..f9759b470 --- /dev/null +++ b/.github/workflows/bump-fluent-bit-version.yaml @@ -0,0 +1,108 @@ +name: Create Pull Request to bump fluent-bit version + +on: + workflow_dispatch: + inputs: + version: + description: 'New fluent-bit version number (e.g., 3.2.4)' + required: true + +jobs: + create-bump-pr: + name: Create target bump pull request + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Git + run: | + git config user.name "GitHub Actions Bot" + git config user.email "actions@github.com" + + - name: Validate version format + run: | + if ! [[ ${{ github.event.inputs.version }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Invalid version format. Please use X.Y.Z" + exit 1 + fi + + - name: Check file existence + run: | + files=( + "cmd/fluent-watcher/fluentbit/VERSION" + "config/samples/fluentbit_v1alpha2_fluentbit.yaml" + "docs/best-practice/forwarding-logs-via-http/deploy/fluentbit-fluentBit.yaml" + "manifests/kubeedge/fluentbit-fluentbit-edge.yaml" + "manifests/logging-stack/fluentbit-fluentBit.yaml" + "manifests/quick-start/fluentbit.yaml" + "manifests/regex-parser/fluentbit-fluentBit.yaml" + "charts/fluent-operator/values.yaml" + ) + for file in "${files[@]}"; do + if [ ! -f "$file" ]; then + echo "File not found: $file" + exit 1 + fi + done + + - name: Update version in VERSION file + run: | + echo ${{ github.event.inputs.version }} > cmd/fluent-watcher/fluentbit/VERSION + if [ $? -ne 0 ]; then + echo "Failed to update VERSION file" + exit 1 + fi + + - name: Update version in manifests + run: | + files=( + "config/samples/fluentbit_v1alpha2_fluentbit.yaml" + "docs/best-practice/forwarding-logs-via-http/deploy/fluentbit-fluentBit.yaml" + "manifests/kubeedge/fluentbit-fluentbit-edge.yaml" + "manifests/logging-stack/fluentbit-fluentBit.yaml" + "manifests/quick-start/fluentbit.yaml" + "manifests/regex-parser/fluentbit-fluentBit.yaml" + ) + for file in "${files[@]}"; do + sed -i 's|image: ghcr.io/fluent/fluent-operator/fluent-bit:.*|image: ghcr.io/fluent/fluent-operator/fluent-bit:${{ github.event.inputs.version }}|' "$file" + if [ $? -ne 0 ]; then + echo "Failed to update $file" + exit 1 + fi + done + + - name: Update version in values.yaml + run: | + sed -i '/repository: "ghcr.io\/fluent\/fluent-operator\/fluent-bit"/!b;n;s/tag: .*/tag: "${{ github.event.inputs.version }}"/' charts/fluent-operator/values.yaml + if [ $? -ne 0 ]; then + echo "Failed to update values.yaml" + exit 1 + fi + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + commit-message: "Bump fluent-bit to ${{ github.event.inputs.version }} + + - Updated VERSION file + - Updated manifest files + - Updated values.yaml in Helm chart" + title: "Bump fluent-bit to ${{ github.event.inputs.version }}" + body: | + This PR updates the version to ${{ github.event.inputs.version }} in the following files: + - cmd/fluent-watcher/fluentbit/VERSION + - config/samples/fluentbit_v1alpha2_fluentbit.yaml + - docs/best-practice/forwarding-logs-via-http/deploy/fluentbit-fluentBit.yaml + - manifests/kubeedge/fluentbit-fluentbit-edge.yaml + - manifests/logging-stack/fluentbit-fluentBit.yaml + - manifests/quick-start/fluentbit.yaml + - manifests/regex-parser/fluentbit-fluentBit.yaml + - charts/fluent-operator/values.yaml + + Please review and merge to release the new version. + branch: bump-fb-to-${{ github.event.inputs.version }} + base: master + labels: | + version-bump + fluent-bit diff --git a/Makefile b/Makefile index cbedd5247..509f181eb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ VERSION?=$(shell cat VERSION | tr -d " \t\n\r") +FB_VERSION?=$(shell cat cmd/fluent-watcher/fluentbit/VERSION | tr -d " \t\n\r") # Image URL to use all building/pushing image targets -FB_IMG ?= ghcr.io/fluent/fluent-operator/fluent-bit:v3.1.8 -FB_IMG_DEBUG ?= ghcr.io/fluent/fluent-operator/fluent-bit:v3.1.8-debug +FB_IMG ?= ghcr.io/fluent/fluent-operator/fluent-bit:v${FB_VERSION} +FB_IMG_DEBUG ?= ghcr.io/fluent/fluent-operator/fluent-bit:v${FB_VERSION}-debug FD_IMG ?= ghcr.io/fluent/fluent-operator/fluentd:v1.17.0 FO_IMG ?= kubesphere/fluent-operator:$(VERSION) FD_IMG_BASE ?= ghcr.io/fluent/fluent-operator/fluentd:v1.17.0-arm64-base