Skip to content

Commit

Permalink
Merge pull request #6 from cw-Guo/feat/bump-fluent-bit-version
Browse files Browse the repository at this point in the history
Feat/bump fluent bit version
  • Loading branch information
cw-Guo authored Jan 4, 2025
2 parents abccb78 + a065f3f commit e775ce5
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 2 deletions.
117 changes: 117 additions & 0 deletions .github/workflows/bump-fluent-bit-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
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 "[email protected]"
- 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: Create bump branch
run: |
git checkout -b bump-fb-to-${{ github.event.inputs.version }}
git push --set-upstream origin bump-fb-to-${{ github.event.inputs.version }}
- 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: Commit & Push changes
run: |
git add 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
git commit -m "Bump fluent-bit version to ${{ github.event.inputs.version }}
- Updated VERSION file
- Updated manifest files
- Updated values.yaml in Helm chart
git push
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
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 }}
labels: |
version-bump
fluent-bit
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit e775ce5

Please sign in to comment.