From 1a4f4b9b2f404a1a67cf45e4481c64a2d7bc4426 Mon Sep 17 00:00:00 2001 From: Kiefer Chang Date: Tue, 30 Nov 2021 17:16:23 +0800 Subject: [PATCH] Add `harvester-release.yaml` file to track versions The file /etc/harvester-release.yaml tracks component versions, e.g.: ``` harvester: f6bc010-dirty harvesterChart: 0.0.0-dev os: Harvester dfd4a9d-dirty kubernetes: v1.21.5+rke2r1 rancher: v2.6-638b29a687f3818e7de676a573ec9b9156f193a9-head monitoringChart: 100.0.0+up16.6.0 ``` Signed-off-by: Kiefer Chang --- .gitignore | 1 + package/harvester-os/Dockerfile | 7 ++++--- scripts/package-harvester-os | 21 +++++++++++++++++++-- scripts/version-rancher | 1 + 4 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 scripts/version-rancher diff --git a/.gitignore b/.gitignore index 33e241fc1..add2e9567 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ *.swp .idea /package/harvester-os/iso/boot/grub2/harvester.cfg +/package/harvester-os/harvester-release.yaml diff --git a/package/harvester-os/Dockerfile b/package/harvester-os/Dockerfile index de233d166..cbc5be008 100644 --- a/package/harvester-os/Dockerfile +++ b/package/harvester-os/Dockerfile @@ -6,8 +6,9 @@ RUN curl -sfL https://github.com/rancher/wharfie/releases/latest/download/wharfi COPY files/ / RUN chmod 0600 /system/oem/* -RUN rm -f /system/oem/05_network.yaml +COPY harvester-release.yaml /etc/ -ARG HARVESTER_INSTALLER_VERSION +ARG HARVESTER_PRETTY_NAME +RUN sed -i "s/^PRETTY_NAME.*/PRETTY_NAME=\"$HARVESTER_PRETTY_NAME\"/g" /etc/os-release && \ + echo GRUB_ENTRY_NAME="\"$HARVESTER_PRETTY_NAME\"" >> /etc/os-release -RUN echo GRUB_ENTRY_NAME="\"Harvester $HARVESTER_INSTALLER_VERSION\"" >> /etc/os-release diff --git a/scripts/package-harvester-os b/scripts/package-harvester-os index 19b2479e5..241f522f1 100755 --- a/scripts/package-harvester-os +++ b/scripts/package-harvester-os @@ -8,14 +8,30 @@ PACKAGE_HARVESTER_OS_DIR="${TOP_DIR}/package/harvester-os" mkdir -p ${ARTIFACTS_DIR} source ${SCRIPTS_DIR}/version +source ${SCRIPTS_DIR}/version-rke2 +source ${SCRIPTS_DIR}/version-rancher +source ${SCRIPTS_DIR}/version-harvester ${TOP_DIR}/../harvester +source ${SCRIPTS_DIR}/version-monitoring BASE_OS_IMAGE="rancher/harvester-os:20211130" HARVESTER_OS_IMAGE=rancher/harvester-os:$VERSION cd ${PACKAGE_HARVESTER_OS_DIR} + +PRETTY_NAME="Harvester ${VERSION}" + +cat > harvester-release.yaml < iso/boot/grub2/harvester.cfg luet-makeiso iso.yaml --image "${HARVESTER_OS_IMAGE}" --output ${ARTIFACTS_DIR}/${ISO_PREFIX} rm ${ARTIFACTS_DIR}/${ISO_PREFIX}.iso.sha256 diff --git a/scripts/version-rancher b/scripts/version-rancher new file mode 100644 index 000000000..8cef1e01f --- /dev/null +++ b/scripts/version-rancher @@ -0,0 +1 @@ +RANCHER_VERSION="v2.6-638b29a687f3818e7de676a573ec9b9156f193a9-head"