Skip to content

Commit

Permalink
Add harvester-release.yaml file to track versions
Browse files Browse the repository at this point in the history
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 <kiefer.chang@suse.com>
  • Loading branch information
bk201 authored and guangbochen committed Dec 1, 2021
1 parent 8f0b55c commit 1a4f4b9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.swp
.idea
/package/harvester-os/iso/boot/grub2/harvester.cfg
/package/harvester-os/harvester-release.yaml
7 changes: 4 additions & 3 deletions package/harvester-os/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 19 additions & 2 deletions scripts/package-harvester-os
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
harvester: ${HARVESTER_VERSION}
harvesterChart: ${HARVESTER_CHART_VERSION}
os: ${PRETTY_NAME}
kubernetes: ${RKE2_VERSION}
rancher: ${RANCHER_VERSION}
monitoringChart: ${MONITORING_VERSION}
EOF

docker build --pull \
--build-arg BASE_OS_IMAGE="${BASE_OS_IMAGE}" \
--build-arg HARVESTER_INSTALLER_VERSION="${VERSION}" \
--build-arg HARVESTER_PRETTY_NAME="${PRETTY_NAME}" \
-t ${HARVESTER_OS_IMAGE} .

PROJECT_PREFIX="harvester"
Expand All @@ -37,7 +53,8 @@ docker rm $(<os-img-container) && rm -f os-img-container

# build ISO
ISO_PREFIX="${PROJECT_PREFIX}-${ARCH}"
[ -d iso ] && yq e ".overlay.isoimage = \"$(pwd)/iso\"" iso.yaml -i
cp harvester-release.yaml iso
yq e ".overlay.isoimage = \"$(pwd)/iso\"" iso.yaml -i
echo "set harvester_version=${VERSION}" > 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
Expand Down
1 change: 1 addition & 0 deletions scripts/version-rancher
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RANCHER_VERSION="v2.6-638b29a687f3818e7de676a573ec9b9156f193a9-head"

0 comments on commit 1a4f4b9

Please sign in to comment.