Skip to content

Commit

Permalink
ci: check whether plugin/gem were installed during upgrading package
Browse files Browse the repository at this point in the history
When major upgrade process was executed, manually installed plugin/gem
should be installed in advance.

This PR test whether that mechanism will be launched.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
  • Loading branch information
kenhys committed Oct 23, 2024
1 parent 981cd89 commit 7c2980e
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,29 @@ jobs:
- name: Build deb with Docker
run: |
rake apt:build APT_TARGETS=${{ matrix.rake-job }}
- name: Build v6 deb with Docker
run: |
git config user.email "fluentd@googlegroups.com"
git config user.name "Fluentd developers"
git am fluent-package/bump-version-v6.patch
rake apt:build APT_TARGETS=${{ matrix.rake-job }}
- name: Relocate packages
run: |
cp -r fluent-package/apt/repositories fluent-package/apt/v6repositories
find fluent-package/apt/repositories -name 'fluent-package_6*.deb' | xargs rm -f
find fluent-package/apt/repositories -name 'td-agent_6*.deb' | xargs rm -f
find fluent-package/apt/v6repositories -name 'fluent-package_5*.deb' | xargs rm -f
find fluent-package/apt/v6repositories -name 'td-agent_5*.deb' | xargs rm -f
- name: Upload fluent-package deb
uses: actions/upload-artifact@master
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/apt/repositories
- name: Upload v6 fluent-package deb
uses: actions/upload-artifact@master
with:
name: v6-packages-${{ matrix.rake-job }}
path: fluent-package/apt/v6repositories
- name: Upload fluent-apt-source deb
uses: actions/upload-artifact@master
with:
Expand Down Expand Up @@ -180,6 +198,10 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
- uses: actions/download-artifact@v4
with:
name: v6-packages-${{ matrix.rake-job }}
path: v6repositories
- uses: actions/download-artifact@v4
with:
name: packages-apt-source-${{ matrix.rake-job }}
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,29 @@ jobs:
- name: Build rpm with Docker
run: |
rake yum:build YUM_TARGETS=${{ matrix.rake-job }}
- name: Build v6 rpm with Docker
run: |
git config user.email "fluentd@googlegroups.com"
git config user.name "Fluentd developers"
git am fluent-package/bump-version-v6.patch
rake yum:build YUM_TARGETS=${{ matrix.rake-job }}
- name: Relocate packages
run: |
cp -r fluent-package/yum/repositories fluent-package/yum/v6repositories
find fluent-package/yum/repositories -name 'fluent-package_6*.rpm | xargs rm -f
find fluent-package/yum/repositories -name 'td-agent_6*.rpm | xargs rm -f
find fluent-package/yum/v6repositories -name 'fluent-package_5*.rpm | xargs rm -f
find fluent-package/yum/v6repositories -name 'td-agent_5*.rpm | xargs rm -f
- name: Upload fluent-package rpm
uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/yum/repositories
- name: Upload v6 fluent-package rpm
uses: actions/upload-artifact@v4
with:
name: v6-packages-${{ matrix.rake-job }}
path: fluent-package/yum/v6repositories
# TODO move the following steps to "Test" job
- name: Check Package Size
run: |
Expand Down
21 changes: 21 additions & 0 deletions fluent-package/apt/systemd-test/update-to-next-major-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -exu

. $(dirname $0)/../commonvar.sh

# Install the current
sudo apt install -V -y \
/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb

# Install plugin manually (plugin and gem)
sudo /opt/fluent/bin/fluent-gem install --no-document fluent-plugin-concat
sudo /opt/fluent/bin/fluent-gem install --no-document linux-utmpx

# Install next major version
sudo apt install -V -y \
/host/v6repositories/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb

# Test: Check whether plugin/gem were installed during upgrading
/opt/fluent/bin/fluent-gem list | grep fluent-plugin-concat
/opt/fluent/bin/fluent-gem list | grep linux-utmpx
65 changes: 65 additions & 0 deletions fluent-package/bump-version-v6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
From 887c36b60822995aa889fea6a181f00975cdfff7 Mon Sep 17 00:00:00 2001
From: Kentaro Hayashi <hayashi@clear-code.com>
Date: Thu, 17 Oct 2024 19:45:02 +0900
Subject: [PATCH 1/2] bump version

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
---
fluent-package/config.rb | 6 +++---
fluent-package/debian/changelog | 6 ++++++
fluent-package/yum/fluent-package.spec.in | 3 +++
3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/fluent-package/config.rb b/fluent-package/config.rb
index a9e13bc..e61bca4 100644
--- a/fluent-package/config.rb
+++ b/fluent-package/config.rb
@@ -1,5 +1,5 @@
PACKAGE_NAME = "fluent-package"
-PACKAGE_VERSION = "5.1.0"
+PACKAGE_VERSION = "6.0.0"

# Keep internal path (/opt/td-agent) for package name migration
SERVICE_NAME = "fluentd"
@@ -23,8 +23,8 @@ OPENSSL_FOR_MACOS_SHA256SUM = "6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d
BUNDLER_VERSION= "2.3.27"

# https://www.ruby-lang.org/en/downloads/ (tar.gz)
-BUNDLED_RUBY_VERSION = "3.2.5"
-BUNDLED_RUBY_SOURCE_SHA256SUM = "ef0610b498f60fb5cfd77b51adb3c10f4ca8ed9a17cb87c61e5bea314ac34a16"
+BUNDLED_RUBY_VERSION = "3.3.5"
+BUNDLED_RUBY_SOURCE_SHA256SUM = "3781a3504222c2f26cb4b9eb9c1a12dbf4944d366ce24a9ff8cf99ecbce75196"

BUNDLED_RUBY_PATCHES = [
# An example entry:
diff --git a/fluent-package/debian/changelog b/fluent-package/debian/changelog
index f24ec3e..0089f56 100644
--- a/fluent-package/debian/changelog
+++ b/fluent-package/debian/changelog
@@ -1,3 +1,9 @@
+fluent-package (6.0.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Kentaro Hayashi <kenhys@xdump.org> Tue, 8 Oct 2024 07:47:29 -0000
+
fluent-package (5.1.0-1) unstable; urgency=low

* New upstream release.
diff --git a/fluent-package/yum/fluent-package.spec.in b/fluent-package/yum/fluent-package.spec.in
index 4833f8e..da9da8c 100644
--- a/fluent-package/yum/fluent-package.spec.in
+++ b/fluent-package/yum/fluent-package.spec.in
@@ -478,6 +478,9 @@ fi
# NOTE: %{_tmpfilesdir} is available since CentOS 7
%attr(0755,fluentd,fluentd) %dir /tmp/@PACKAGE_DIR@
%changelog
+* Mon Oct 7 2024 Kentaro Hayashi <kenhys@xdump.org> - 6.0.0-1
+- New upstream release. (Dummy)
+
* Mon Jul 29 2024 Kentaro Hayashi <kenhys@xdump.org> - 5.1.0-1
- New upstream release.

--
2.45.2

21 changes: 21 additions & 0 deletions fluent-package/yum/systemd-test/update-to-next-major-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -exu

. $(dirname $0)/commonvar.sh

# Install the current
package="/host/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-*.rpm"
sudo $DNF install -y $package

# Install plugin manually (plugin and gem)
sudo /opt/fluent/bin/fluent-gem install --no-document fluent-plugin-concat
sudo /opt/fluent/bin/fluent-gem install --no-document linux-utmpx

# Install next major version
package="/host/v6repositories/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-*.rpm"
sudo $DNF install -y $package

# Test: Check whether plugin/gem were installed during upgrading
/opt/fluent/bin/fluent-gem list | grep fluent-plugin-concat
/opt/fluent/bin/fluent-gem list | grep linux-utmpx

0 comments on commit 7c2980e

Please sign in to comment.